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.

Note

Feature sets are evaluated in batches, where each batch is one step in the sequential feature selection.

Dictionary

This FSelector can be instantiated via the dictionary mlr_fselectors or with the associated sugar function fs():

mlr_fselectors$get("sequential")
fs("sequential")

Parameters

max_features

integer(1)
Maximum number of features. By default, number of features in mlr3::Task.

strategy

character(1)
Search method sfs (forward search) or sbs (backward search).

Super class

mlr3fselect::FSelector -> FSelectorSequential

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.`

Usage

FSelectorSequential$new()


Method optimization_path()

Returns the optimization path.

Usage

FSelectorSequential$optimization_path(inst)

Arguments

inst

(FSelectInstanceSingleCrit)
Instance optimized with FSelectorSequential.

Returns

data.table::data.table


Method clone()

The objects of this class are cloneable with this method.

Usage

FSelectorSequential$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

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") # \donttest{ # Modifies the instance by reference fselector$optimize(instance)
#> Petal.Length Petal.Width Sepal.Length Sepal.Width features classif.ce #> 1: FALSE TRUE FALSE FALSE Petal.Width 0.02
# Returns best scoring evaluation instance$result
#> Petal.Length Petal.Width Sepal.Length Sepal.Width features classif.ce #> 1: FALSE TRUE FALSE FALSE Petal.Width 0.02
# Allows access of data.table of full path of all evaluations as.data.table(instance$archive)# }
#> Petal.Length Petal.Width Sepal.Length Sepal.Width classif.ce #> 1: TRUE FALSE FALSE FALSE 0.06 #> 2: FALSE TRUE FALSE FALSE 0.02 #> 3: FALSE FALSE TRUE FALSE 0.26 #> 4: FALSE FALSE FALSE TRUE 0.42 #> 5: TRUE TRUE FALSE FALSE 0.06 #> 6: FALSE TRUE TRUE FALSE 0.02 #> 7: FALSE TRUE FALSE TRUE 0.02 #> uhash timestamp batch_nr #> 1: e1fab8f1-9eaf-4477-bda2-5dcb035c2439 2021-03-21 04:30:42 1 #> 2: 8663c02f-3d9b-4234-8d21-0b7f5037edb5 2021-03-21 04:30:42 1 #> 3: ca0050d5-8efc-4ba3-948c-00cebddfb310 2021-03-21 04:30:42 1 #> 4: 2344cccf-ec65-415c-ba99-8bf98aaef42d 2021-03-21 04:30:42 1 #> 5: b0171f32-f8eb-4a35-90ce-9ae01bce49b1 2021-03-21 04:30:43 2 #> 6: 69cdaa8a-6549-4308-ad49-44ce4a7ea14a 2021-03-21 04:30:43 2 #> 7: 9de4e76a-783f-4ce8-a825-aed181d95ff1 2021-03-21 04:30:43 2