Skip to contents

Function to optimize the feature set of a mlr3::Learner.

Usage

fselect(
  method,
  task,
  learner,
  resampling,
  measures,
  term_evals = NULL,
  term_time = NULL,
  store_models = FALSE,
  ...
)

Arguments

method

(character(1) | FSelector)
Key to retrieve fselector from mlr_fselectors dictionary or FSelector object.

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.

measures

(list of mlr3::Measure)
Measures to optimize. If NULL, mlr3's default measure is used.

term_evals

(integer(1))
Number of allowed evaluations.

term_time

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

store_models

(logical(1)). Store models in benchmark result?

...

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

Value

FSelectInstanceSingleCrit | FSelectInstanceMultiCrit

Examples

task = tsk("pima")

instance = fselect(
  method = "random_search",
  task = task,
  learner = lrn("classif.rpart"),
  resampling = rsmp ("holdout"),
  measures = msr("classif.ce"),
  term_evals = 4)

# subset task to optimized feature set
task$select(instance$result_feature_set)