Description:
Set model building parameters.
Syntax:
ym_setparam(md, key:value,…)
Note:
The external library function (See External Library Guide) sets parameters for model building.
Parameter:
md |
An MD object |
key |
A parameter name |
value |
A parameter value |
Key |
Value Type |
Description |
balance |
int |
Balanced sampling ratio |
target |
String |
A target variable |
id |
String |
ID variable name |
intelligence |
boolean |
Auto-impute a value or not |
misformat |
String |
Missing value format |
optimal |
boolean |
Use the optimal parameter configuration or not |
parallel |
int |
Pre-set the number of parallel tasks |
resample |
boolean |
Resample or not |
resamplemul |
int |
Resample multiplier |
resamplenum |
int |
Frequency of resampling |
testpercent |
int |
Test data percentage (0-99) |
vartypes |
ArrayList< Byte> |
Set variable type; the byte value is the constant of F_ configured in Consts |
Fields |
ArrayList<String> |
Field names for model building |
Return value:
A Boolean value
Example:
|
A |
|
1 |
=ym_env() |
Start Python service |
2 |
=file("train.csv") |
|
3 |
=ym_model(A1,A2) |
Load data for model building |
4 |
=ym_setparam(A3,"balance":2,"target":"Survived","modelFieldNames":["PassengerId","Survived","Pclass","Name","Sex","Age","SibSp"],"intelligence":"true") |
Set model building parameters, where the parameters for which values should be properly set is 2, the target variable is Survived, the order of field names for model building is PassengerId, Survived, Pclass, Name, Sex, Age and SibSp, and set auto-assign value |
5 |
>ym_close(A1) |
Close Python service |