Learn R Programming

mlr3fselect (version 1.3.0)

mlr_fselectors_shadow_variable_search: Feature Selection with Shadow Variable Search

Description

Feature selection using the Shadow Variable Search Algorithm. Shadow variable search creates for each feature a permutated copy and stops when one of them is selected.

Arguments

Resources

The gallery features a collection of case studies and demos about optimization.

Dictionary

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

fs("shadow_variable_search")

Super classes

mlr3fselect::FSelector -> mlr3fselect::FSelectorBatch -> FSelectorBatchShadowVariableSearch

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.`

Usage

FSelectorBatchShadowVariableSearch$new()


Method optimization_path()

Returns the optimization path.

Usage

FSelectorBatchShadowVariableSearch$optimization_path(inst)

Arguments

inst

(FSelectInstanceBatchSingleCrit)
Instance optimized with FSelectorBatchShadowVariableSearch.


Method clone()

The objects of this class are cloneable with this method.

Usage

FSelectorBatchShadowVariableSearch$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

The feature selection terminates itself when the first shadow variable is selected. It is not necessary to set a termination criterion.

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_sequential

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("shadow_variable_search"),
  task = task,
  learner = learner,
  resampling = rsmp("holdout"),
  measure = msr("classif.ce"),
)

# best performing feature subset
instance$result

# all evaluated feature subsets
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