mlr_fselectors_sequential {mlr3fselect} | R Documentation |
Feature Selection with Sequential Search
Description
Feature selection using Sequential Search Algorithm.
Details
Sequential forward selection (strategy = fsf
) extends the feature set in each iteration with the feature that increases the model's performance the most.
Sequential backward selection (strategy = fsb
) follows the same idea but starts with all features and removes features from the set.
The feature selection terminates itself when min_features
or max_features
is reached.
It is not necessary to set a termination criterion.
Dictionary
This FSelector can be instantiated with the associated sugar function fs()
:
fs("sequential")
Control Parameters
min_features
integer(1)
Minimum number of features. By default, 1.max_features
integer(1)
Maximum number of features. By default, number of features in mlr3::Task.strategy
character(1)
Search methodsfs
(forward search) orsbs
(backward search).
Super classes
mlr3fselect::FSelector
-> mlr3fselect::FSelectorBatch
-> FSelectorBatchSequential
Methods
Public methods
Inherited methods
Method new()
Creates a new instance of this R6 class.'
Usage
FSelectorBatchSequential$new()
Method optimization_path()
Returns the optimization path.
Usage
FSelectorBatchSequential$optimization_path(inst, include_uhash = FALSE)
Arguments
inst
(FSelectInstanceBatchSingleCrit)
Instance optimized with FSelectorBatchSequential.include_uhash
(
logical(1)
)
Includeuhash
column?
Returns
Method clone()
The objects of this class are cloneable with this method.
Usage
FSelectorBatchSequential$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
See Also
Other FSelector:
FSelector
,
mlr_fselectors
,
mlr_fselectors_design_points
,
mlr_fselectors_exhaustive_search
,
mlr_fselectors_genetic_search
,
mlr_fselectors_random_search
,
mlr_fselectors_rfe
,
mlr_fselectors_rfecv
,
mlr_fselectors_shadow_variable_search
Examples
# Feature Selection
# retrieve task and load learner
task = tsk("penguins")
learner = lrn("classif.rpart")
# run feature selection on the Palmer Penguins data set
instance = fselect(
fselector = fs("sequential"),
task = task,
learner = learner,
resampling = rsmp("holdout"),
measure = msr("classif.ce"),
term_evals = 10
)
# best performing feature set
instance$result
# all evaluated feature sets
as.data.table(instance$archive)
# subset the task and fit the final model
task$select(instance$result_feature_set)
learner$train(task)