AutoFSelector is a mlr3::Learner which wraps another mlr3::Learner
and performs the following steps during
The wrapped (inner) learner is trained on the feature subsets via resampling. The feature selection can be specified by providing a FSelector, a bbotk::Terminator, a mlr3::Resampling and a mlr3::Measure.
A final model is fit on the complete training data with the best found feature subset.
AutoFSelector just calls the predict method of the
wrapped (inner) learner.
Note that this approach allows to perform nested resampling by passing an
AutoFSelector object to
To access the inner resampling results, set
store_fselect_instance = TRUE
store_models = TRUE.
All arguments from construction to create the FSelectInstanceSingleCrit.
Stores the feature selection algorithm.
Returns FSelectInstanceSingleCrit archive.
Internally created feature selection instance with all intermediate results.
$result from FSelectInstanceSingleCrit.
Creates a new instance of this R6 class.
AutoFSelector$new( learner, resampling, measure, terminator, fselector, store_fselect_instance = TRUE, store_benchmark_result = TRUE, store_models = FALSE, check_values = FALSE )
Learner to optimize the feature subset for, see FSelectInstanceSingleCrit.
Resampling strategy during feature selection, see FSelectInstanceSingleCrit. This mlr3::Resampling is meant to be the inner resampling, operating on the training set of an arbitrary outer resampling. For this reason it is not feasible to pass an instantiated mlr3::Resampling here.
Performance measure to optimize.
When to stop feature selection, see FSelectInstanceSingleCrit.
Feature selection algorithm to run.
TRUE (default), stores the internally created
FSelectInstanceSingleCrit with all intermediate results in slot
Store benchmark result in archive?
Store models in benchmark result?
Check the parameters before the evaluation and the results for validity?
The objects of this class are cloneable with this method.
AutoFSelector$clone(deep = FALSE)
Whether to make a deep clone.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
library(mlr3) task = tsk("iris") learner = lrn("classif.rpart") resampling = rsmp("holdout") measure = msr("classif.ce") terminator = trm("evals", n_evals = 3) fselector = fs("exhaustive_search") afs = AutoFSelector$new(learner, resampling, measure, terminator, fselector, store_fselect_instance = TRUE) afs$train(task) afs$model afs$learner
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.