mlr_fselectors_genetic_search: Feature Selection with Genetic Search

mlr_fselectors_genetic_searchR Documentation

Feature Selection with Genetic Search

Description

Feature selection using the Genetic Algorithm from the package genalg.

Dictionary

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

fs("genetic_search")

Control Parameters

For the meaning of the control parameters, see genalg::rbga.bin(). genalg::rbga.bin() internally terminates after iters iteration. We set ìters = 100000 to allow the termination via our terminators. If more iterations are needed, set ìters to a higher value in the parameter set.

Super class

mlr3fselect::FSelector -> FSelectorGeneticSearch

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
FSelectorGeneticSearch$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
FSelectorGeneticSearch$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

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

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("genetic_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)


mlr3fselect documentation built on March 7, 2023, 5:31 p.m.