The FSelectInstanceMultiCrit specifies a feature selection problem for FSelectors.
fsi() creates a FSelectInstanceMultiCrit and the function
fselect() creates an instance internally.
There are several sections about feature selection in the mlr3book.
Learn about multi-objective optimization (Tuning workflow is transferable to feature selection).
The gallery features a collection of case studies and demos about optimization.
For analyzing the feature selection results, it is recommended to pass the archive to
The returned data table is joined with the benchmark result which adds the mlr3::ResampleResult for each feature set.
The archive provides various getters (e.g.
$learners()) to ease the access.
All getters extract by position (
i) or unique hash (
For a complete list of all getters see the methods section.
The benchmark result (
$benchmark_result) allows to score the feature sets again on a different measure.
Alternatively, measures can be supplied to
Feature sets for task subsetting.
Creates a new instance of this R6 class.
FSelectInstanceMultiCrit$new( task, learner, resampling, measures, terminator, store_benchmark_result = TRUE, store_models = FALSE, check_values = FALSE, callbacks = list() )
Task to operate on.
Learner to optimize the feature subset for.
Resampling that is used to evaluated the performance of the feature subsets. Uninstantiated resamplings are instantiated during construction so that all feature subsets are evaluated on the same data splits. Already instantiated resamplings are kept unchanged.
(list of mlr3::Measure)
Measures to optimize. If
NULL, mlr3's default measure is used.
Stop criterion of the feature selection.
Store benchmark result in archive?
Store models in benchmark result?
Check the parameters before the evaluation and the results for validity?
(list of CallbackFSelect)
List of callbacks.
The FSelector object writes the best found feature subsets and estimated performance values here. For internal use.
x values as
data.table. Each row is one point. Contains the value in
the search space of the FSelectInstanceMultiCrit object. Can contain
additional columns for extra information.
Optimal outcomes, e.g. the Pareto front.
The objects of this class are cloneable with this method.
FSelectInstanceMultiCrit$clone(deep = FALSE)
Whether to make a deep clone.
# Feature selection on Palmer Penguins data set task = tsk("penguins") # Construct feature selection instance instance = fsi( task = task, learner = lrn("classif.rpart"), resampling = rsmp("cv", folds = 3), measures = msrs(c("classif.ce", "time_train")), terminator = trm("evals", n_evals = 4) ) # Choose optimization algorithm fselector = fs("random_search", batch_size = 2) # Run feature selection fselector$optimize(instance) # Optimal feature sets instance$result_feature_set # Inspect all evaluated sets as.data.table(instance$archive)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.