Learn R Programming

mlr (version 2.3)

makeFeatSelWrapper: Fuse learner with feature selection.

Description

Fuses a base learner with a search strategy to select variables. Creates a learner object, which can be used like any other learner object, but which internally uses selectFeatures. If the train function is called on it, the search strategy and resampling are invoked to select an optimal set of variables. Finally, a model is fitted on the complete training data with these variables and returned. See selectFeatures for more details.

After training, the optimal features (and other related information) can be retrieved with getFeatSelResult.

Usage

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

Arguments

Value

[Learner].

See Also

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

Other wrapper: CostSensClassifModel, CostSensClassifWrapper, makeCostSensClassifWrapper; CostSensRegrModel, CostSensRegrWrapper, makeCostSensRegrWrapper; makeBaggingWrapper; makeDownsampleWrapper; makeFilterWrapper; makeImputeWrapper; makeMulticlassWrapper; makeOverBaggingWrapper; makeOversampleWrapper, makeUndersampleWrapper; makePreprocWrapperCaret; makePreprocWrapper; makeSMOTEWrapper; makeTuneWrapper; makeWeightedClassesWrapper

Examples

Run this code
# nested resampling with feature selection (with a pretty stupid algorithm for selection)
outer = makeResampleDesc("CV", iters = 2L)
inner = makeResampleDesc("Holdout")
ctrl = makeFeatSelControlRandom(maxit = 3)
lrn = makeFeatSelWrapper("classif.ksvm", resampling = inner, control = ctrl)
# we also extract the selected features for all iteration here
r = resample(lrn, iris.task, outer, extract = getFeatSelResult)

Run the code above in your browser using DataLab