Learn R Programming

mlr (version 2.3)

selectFeatures: Feature selection by wrapper approach.

Description

Optimizes the features for a classification or regression problem by choosing a variable selection wrapper approach. Allows for different optimization methods, such as forward search or a genetic algorithm. You can select such an algorithm (and its settings) by passing a corresponding control object. For a complete list of implemented algorithms look at the subclasses of [FeatSelControl].

All algorithms operate on a 0-1-bit encoding of candidate solutions. Per default a single bit corresponds to a single feature, but you are able to change this by using the arguments bit.names and bits.to.features. Thus allowing you to switch on whole groups of features with a single bit.

Usage

selectFeatures(learner, task, resampling, measures, bit.names, bits.to.features,
  control, show.info = getMlrOption("show.info"))

Arguments

Value

[FeatSelResult].

See Also

Other featsel: FeatSelControl, FeatSelControlExhaustive, FeatSelControlGA, FeatSelControlRandom, FeatSelControlSequential, makeFeatSelControlExhaustive, makeFeatSelControlGA, makeFeatSelControlRandom, makeFeatSelControlSequential; analyzeFeatSelResult; getFeatSelResult; makeFeatSelWrapper

Examples

Run this code
rdesc = makeResampleDesc("Holdout")
ctrl = makeFeatSelControlSequential(method = "sfs", maxit = NA)
res = selectFeatures("classif.rpart", iris.task, rdesc, control = ctrl)
analyzeFeatSelResult(res)

Run the code above in your browser using DataLab