Unified API for model training with parameter tuning

hanaml.train(
  data,
  method,
  trControl = NULL,
  tuneGrid = NULL,
  metric,
  param.search.strategy = NULL,
  resampling.method = NULL,
  ...
)

Arguments

data

DataFrame
DataFrame containting the data.

method

character
Name of HANA ML functions.

trControl

train.control
Pass train.control function.

tuneGrid

param.grid
Pass param.grid function.

metric

character
Scoring metric. Identical to evaluation.metric in HANA ML functions. then no model evaluation or parameter selection will be activated.
No default value.

param.search.strategy

c("grid", "random"), optional
Specifies the method to activate parameter selection. If not specified, model parameter selection shall not be triggered.

resampling.method

character, optional
Specifies the resampling values.

...

Reserved parameter.

Value

a HANA ML object.

Examples


> 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")

See also