FSelectorSequential class that implements sequential feature selection. The
sequential forward selection (
strategy = fsf) extends the feature set in
each step with the feature that increases the models performance the most.
The sequential backward selection (
strategy = fsb) starts with the complete
future set and removes in each step the feature that decreases the models
performance the least.
This FSelector can be instantiated via the dictionary
mlr_fselectors or with the associated sugar function
Maximum number of features. By default, number of features in mlr3::Task.
sfs (forward search) or
sbs (backward search).
Creates a new instance of this R6 class.'
Returns the optimization path.
Instance optimized with FSelectorSequential.
The objects of this class are cloneable with this method.
FSelectorSequential$clone(deep = FALSE)
Whether to make a deep clone.
Feature sets are evaluated in batches, where each batch is one step in the sequential feature selection.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
library(mlr3) terminator = trm("evals", n_evals = 5) instance = FSelectInstanceSingleCrit$new( task = tsk("iris"), learner = lrn("classif.rpart"), resampling = rsmp("holdout"), measure = msr("classif.ce"), terminator = terminator ) fselector = fs("sequential") # Modifies the instance by reference fselector$optimize(instance) # Returns best scoring evaluation instance$result # Allows access of data.table of full path of all evaluations as.data.table(instance$archive)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.