P.mvp()

Description:

The external library function (See External Library Guide) creates indicator variables for the MVP analysis and automatically perform the subsequent handling according to a table sequence/record sequence of indicator variables for missing values.

Syntax:

P.mvp(cns, T)

During modeling, create indicator variables for MVP analysis and automatically perform the subsequent handling according to multiple missing value indicator variables, and return a binary sequence consisting of two bits – the first bit represents a table sequence made up of MVP columns and the second one is sequence Rec of creation and handling records; when the object is a record sequence and when the sequence of column names in column MI, automatically search for the indicator column for the missing values and perform corresponding computation.

P.mvp@r(cns, Rec)

During scoring, create a table sequence consisting of indicator variables for MVP columns according to missing value indicator variables and sequence Rec of creation and handling records.

Parameter:

P

A table sequence/record sequence.

T

A sequence of target variable values.

cns

A sequence of names of columns ( or column numbers starting from 1) of a record sequence.

Rec

A sequence of creation and handling records.

Option:

@bnie

Each option specifies a target type, and options are mutual-exclusive; automatically judge the type when no option is used; the order of priorities of the options is binary, numeric, integer and enumerated.

Return value:

Sequence

Example:

 

A

 

1

=T("D://house_prices_train.csv")

Import modeling data.

2

=T("D://house_prices_test.csv")

Import scoring data.

3

=A1.mi("LotFrontage")

Return a sequence of indicator variables for missing values in “LotFrontage”.

4

=A1.mi("Alley")

Return a sequence of indicator variables for missing values inf “Alley”.

5

=A1.derive(A3(#).field(1):MI_LotFrontage,A4(#).field(1):MI_Alley)

Add MI indicator variable to the data.

6

=A5.mvp(["MI_LotFrontage","MI_Alley"],A1.(SalePrice))

A6(1): A table sequence containing MVP columns;

A6(2): A sequence of creation and handling records Rec.

7

=A2.mi("LotFrontage")

 

8

=A2.mi("Alley")

 

9

=A2.derive(A3(#).field(1):MI_LotFrontage,A4(#).field(1):MI_Alley)

 

10

=A9.mvp@r(["MI_LotFrontage","MI_Alley"],A6(2))

Return a table sequence made up of indicator variables of MVP columns for the scoring.