Learn R Programming

mlr3fselect (version 1.3.0)

mlr_fselectors_exhaustive_search: Feature Selection with Exhaustive Search

Description

Feature Selection using the Exhaustive Search Algorithm. Exhaustive Search generates all possible feature sets.

Arguments

Dictionary

This FSelector can be instantiated with the associated sugar function fs():

fs("exhaustive_search")

Control Parameters

max_features

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

Super classes

mlr3fselect::FSelector -> mlr3fselect::FSelectorBatch -> FSelectorBatchExhaustiveSearch

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

FSelectorBatchExhaustiveSearch$new()


Method clone()

The objects of this class are cloneable with this method.

Usage

FSelectorBatchExhaustiveSearch$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

The feature selection terminates itself when all feature sets are evaluated. It is not necessary to set a termination criterion.

See Also

Other FSelector: FSelector, mlr_fselectors, mlr_fselectors_design_points, mlr_fselectors_genetic_search, mlr_fselectors_random_search, mlr_fselectors_rfe, mlr_fselectors_rfecv, mlr_fselectors_sequential, mlr_fselectors_shadow_variable_search

Examples

Run this code
# Feature Selection
# \donttest{

# 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("exhaustive_search"),
  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)
# }

Run the code above in your browser using DataLab