impute()

Read(39) Label: impute,

Here are how to use impute() functions.

A.impute()

Description:

The external library function imputes missing values to a sequence type variable during modeling.

Syntax:

A.impute()

During modeling, impute missing values to variable A and return a binary sequence containing the imputation result and imputation process records Rec

A.impute@r(Rec)

During scoring, impute missing values to variable A according to imputation process records Rec

Parameters:

A

A sequence

Rec

A sequence of imputation process records

Options:

@c

Modify the original data to the imputation result after execution

@BNIED

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 date

Return value:

A sequence

Example:

 

A

 

1

[1,2,3,,5,6,7,8,9,10]

 

2

=A1.impute@N()

Impute missing data to A1:

A3(1) Return imputation result

A3(2) Imputation process records Rec

@N specifies the type of variable as numeric

3

=A1.impute@rc(A2(2))

Impute missing data to A1 according to A2’s imputation process records Rec

P.impute()

Description:

The external library function imputes missing values to a table sequence/record sequence type variable during modeling.

Syntax:

P.impute(cn)

During modeling, impute missing values to variable cn and return a binary sequence containing the imputation result and imputation process records Rec

P.impute@r(cn, Rec)

During scoring, impute missing values to variable cn according to imputation process records Rec

Parameters:

P

A table sequence/record sequence

cn

A string/number, which is the name of column (or the column number starting from 1) – the to-be-pre-processed variable – in a table sequence or record sequence

Rec

A sequence of imputation process records

Options:

@c

Modify the original data to the imputation result after execution

@BNIED

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 date

Return value:

A sequence

Example:

 

A

 

1

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

 

2

=A1.impute@I(4)

Impute missing values to the variable of column 4:

A2(1) Imputation result

A2(2) Imputation process records

@I specifies the type of variable as integer

3

=A1.impute@rc("LotFrontage",A2(2))

Impute missing data to A1’s variable according to A2’s imputation process records and return imputation result

@c enables changing the original data to the imputation result after execution