Function to tune a mlr3::Learner.

tune(
  method,
  task,
  learner,
  resampling,
  measure,
  term_evals = NULL,
  term_time = NULL,
  search_space = NULL,
  ...
)

Arguments

method

(character(1))
Key to retrieve tuner from mlr_tuners dictionary.

task

(mlr3::Task)
Task to operate on.

learner

(mlr3::Learner).

resampling

(mlr3::Resampling)
Uninstantiated resamplings are instantiated during construction so that all configurations are evaluated on the same data splits. If a new resampling is passed, it is instantiated with new data splits. Already instantiated resamplings are kept unchanged.

measure

(mlr3::Measure)
Measure to optimize.

term_evals

(integer(1))
Number of allowed evaluations.

term_time

(integer(1))
Maximum allowed time in seconds.

search_space

(paradox::ParamSet).

...

(named list())
Named arguments to be set as parameters of the tuner.

Value

TuningInstanceSingleCrit

Examples

learner = lrn("classif.rpart") learner$param_set$values$minsplit = to_tune(1, 10) instance = tune( method = "random_search", task = tsk("pima"), learner = learner, resampling = rsmp ("holdout"), measure = msr("classif.ce"), term_evals = 50, batch_size = 10) # Apply hyperparameter values to learner learner$param_set$values = instance$result_learner_param_vals