Description Usage Arguments Value See Also Examples
View source: R/FilterWrapper.R
Fuses a base learner with a filter method. Creates a learner object, which can be
used like any other learner object.
Internally uses filterFeatures
before every model fit.
After training, the selected features can be retrieved with
getFilteredFeatures
.
Note that observation weights do not influence the filtering and are simply passed down to the next learner.
1 2 3 |
learner |
[ |
fw.method |
[ |
fw.perc |
[ |
fw.abs |
[ |
fw.threshold |
[ |
fw.mandatory.feat |
[ |
... |
[any] |
[Learner
].
Other filter: filterFeatures
,
generateFilterValuesData
,
getFilterValues
,
getFilteredFeatures
,
listFilterMethods
,
makeFilter
,
plotFilterValuesGGVIS
,
plotFilterValues
Other wrapper: makeBaggingWrapper
,
makeClassificationViaRegressionWrapper
,
makeConstantClassWrapper
,
makeCostSensClassifWrapper
,
makeCostSensRegrWrapper
,
makeDownsampleWrapper
,
makeDummyFeaturesWrapper
,
makeExtractFDAFeatsWrapper
,
makeFeatSelWrapper
,
makeImputeWrapper
,
makeMulticlassWrapper
,
makeMultilabelBinaryRelevanceWrapper
,
makeMultilabelClassifierChainsWrapper
,
makeMultilabelDBRWrapper
,
makeMultilabelNestedStackingWrapper
,
makeMultilabelStackingWrapper
,
makeOverBaggingWrapper
,
makePreprocWrapperCaret
,
makePreprocWrapper
,
makeRemoveConstantFeaturesWrapper
,
makeSMOTEWrapper
,
makeTuneWrapper
,
makeUndersampleWrapper
,
makeWeightedClassesWrapper
1 2 3 4 5 6 7 8 9 10 11 12 | task = makeClassifTask(data = iris, target = "Species")
lrn = makeLearner("classif.lda")
inner = makeResampleDesc("Holdout")
outer = makeResampleDesc("CV", iters = 2)
lrn = makeFilterWrapper(lrn, fw.perc = 0.5)
mod = train(lrn, task)
print(getFilteredFeatures(mod))
# now nested resampling, where we extract the features that the filter method selected
r = resample(lrn, task, outer, extract = function(model) {
getFilteredFeatures(model)
})
print(r$extract)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.