Description:
The external library function (See External Library Guide) splits a low-frequency categorical enumerated table sequence/record sequence variable that contains a number of categories not greater than 6 into multiple binary variables during modeling.
Syntax:
P.bi(cn) |
During modeling, split low-frequency categorical enumerated variable cn that contains a number of categories not greater than 6 into multiple binary variables, and return a binary sequence consisting of a table sequence of splitting result and a sequence of splitting process records Rec. |
P.bi@r(cn, Rec) |
During scoring, split low-frequency categorical enumerated variable cn that contains a number of categories not greater than 6 into multiple binary variables according to the sequence of splitting process records Rec, and return result as a table sequence. |
Parameter:
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 splitting process records. |
Return value:
Sequence/Table sequence
Example:
|
A |
|
1 |
=T("D://house_prices_train.csv") |
|
2 |
=A1.bi("MSZoning") |
Split variable “MSZoning” into multiple binary variables. A2(1) Splitting result; A2(2) Splitting process records Rec. |
3 |
=A1.bi@r("MSZoning",A2(2)) |
Split A1’s variable according to A2’s splitting process records. |