Learn R Programming

mlr (version 2.3)

makeBaggingWrapper: Fuse learner with the bagging technique.

Description

Fuses a learner with the bagging method (i.e., similar to what a randomForest does). Creates a learner object, which can be used like any other learner object. Models can easily be accessed via getHomogeneousEnsembleModels.

Bagging is implemented as follows: For each iteration a random data subset is sampled (with or without replacement) and potentially the number of features is also restricted to a random subset. Note that this is usually handled in a slightly different way in the random forest where features are sampled at each tree split).

Prediction works as follows: For classification we do majority voting to create a discrete label and probabilities are predicted by considering the proportions of all predicted labels. For regression the mean value and the standard deviations across predictions is computed.

Note that the passed base learner must always have predict.type = 'response', while the BaggingWrapper can estimate probabilities and standard errors, so it can be set, e.g., to predict.type = 'prob'. For this reason, when you call setPredictType, the type is only set for the BaggingWrapper, not passed down to the inner learner.

Usage

makeBaggingWrapper(learner, bw.iters = 10L, bw.replace = TRUE, bw.size,
  bw.feats = 1)

Arguments

Value

[Learner].

See Also

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