hanaml.train.RdUnified API for model training with parameter tuning
hanaml.train( data, method, trControl = NULL, tuneGrid = NULL, metric, param.search.strategy = NULL, resampling.method = NULL, ... )
| data |
|
|---|---|
| method |
|
| trControl |
|
| tuneGrid |
|
| metric |
|
| param.search.strategy |
|
| resampling.method |
|
| ... | Reserved parameter. |
a HANA ML object.
> trctrl <- hanaml.trainControl(resampling.method = "cv",
param.search.strategy = "grid",
fold.num = 2, repeat.times = 2,
random.state = 1,
progress.indicator.id = "TEST")
> paramgrid <- hanaml.expand.grid(enet.lambda = c(1e-2, 1e-3, 0.05),
enet.alpha = c(0.1, 0.5, 0.03))
> lr <- hanaml.train(data = df.fit.enet,
method = "LinearRegression",
trControl = trctrl,
tuneGrid = paramgrid,
metric = "rmse",
key = "ID", label = "Y",
solver = "admm")