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 x_domain #> 1: FALSE TRUE FALSE FALSE Petal.Width <list[4]> #> classif.ce #> 1: 0.02
# Returns best scoring evaluation instance$result
#> Petal.Length Petal.Width Sepal.Length Sepal.Width features x_domain #> 1: FALSE TRUE FALSE FALSE Petal.Width <list[4]> #> classif.ce #> 1: 0.02
# Allows access of data.table of full path of all evaluations instance$archive$data()# }
#> 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 x_domain timestamp batch_nr #> 1: 0a3a74ce-0f71-4ad5-bfce-a3153af6779b <list[4]> 2020-10-31 04:26:26 1 #> 2: c82ecc0b-12de-409c-bb15-c686215801eb <list[4]> 2020-10-31 04:26:26 1 #> 3: 584ed43e-23a8-45fe-8427-4f8b97805602 <list[4]> 2020-10-31 04:26:26 1 #> 4: ce23efa8-0dec-421e-ad87-a3cbaf9f63d5 <list[4]> 2020-10-31 04:26:26 1 #> 5: 56a22343-50b0-45da-af27-fd3090d6fff2 <list[4]> 2020-10-31 04:26:27 2 #> 6: 785e4064-7849-4541-a42d-80b8c61082e1 <list[4]> 2020-10-31 04:26:27 2 #> 7: d2eee4ee-1d73-4fee-92b8-b5ca5af5108d <list[4]> 2020-10-31 04:26:27 2