Description:
The external library function (See External Library Guide) performs smoothing on a table sequence/record sequence variable of a table sequence/ record sequence during modeling.
Sytnax:
P.smooth(cn, T) |
During modeling, perform smoothing on high-frequency categorical enumerated variable cn and return a binary sequence containing the smoothing result and the smoothing records Rec |
P.smooth@r(cn, Rec) |
During scoring, perform smoothing on multiclassification enumerated variable cn according to Rec, the smoothing process records, and return the smoothing result |
Parameter:
P |
A table sequence/record sequence |
T |
A sequence of target variable values |
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 smoothing process records |
Option:
@c |
Modify the original data to the smoothing result after execution |
@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:
A sequence
Example:
|
A |
|
1 |
=file("D:// titanic.csv").import@qtc() |
Import the modeling data. |
2 |
=file("D:// titanic_t.csv").import@qtc() |
Import the scoring data. |
3 |
=A1.smooth@ic("Ticket",A1.(Survived)) |
Smooth variable “Ticket” and return the smoothing result and the smoothing process records Rec. |
4 |
=A2.smooth@rc("Ticket",A3(2)) |
Map the corresponding variable in the scoring data set according to A3’s smoothing process records. |