Skip to contents

Elastic net model is fitted at the defined rate (r_subsample) of the input dataset by grid search.

Usage

fit_base_elnet(
  dt_imputed,
  folds = NULL,
  yvar = "Arithmetic.Mean",
  xvar = seq(5, ncol(dt_imputed)),
  tune_mode = "grid",
  tune_bayes_iter = 50L,
  vfold = 5L,
  nthreads = 16L,
  trim_resamples = TRUE,
  return_best = FALSE,
  ...
)

Arguments

dt_imputed

The input data table to be used for fitting.

folds

pre-generated rset object with minimal number of columns. If NULL, vfold should be numeric to be used in rsample::vfold_cv.

yvar

The target variable.

xvar

The predictor variables.

tune_mode

character(1). Hyperparameter tuning mode. Default is "grid", "bayes" is acceptable.

tune_bayes_iter

integer(1). The number of iterations for Bayesian optimization. Default is 50. Only used when tune_mode = "bayes".

vfold

The number of folds for cross-validation.

nthreads

The number of threads to be used. Default is 16L.

return_best

logical(1). If TRUE, the best tuned model is returned.

...

Additional arguments to be passed.

Value

The fitted workflow.

Note

tune package should be 1.2.0 or higher.