Mlr - Models of ensembles

The mlr package is great, and the idea of ​​creating a ModelMultiplexer also helps. But ModelMultiplexer " selects " 1 single model from the models used.

Is there support or planned support to create an integrated or enhanced ensemble of individual models?

bls = list(
  makeLearner("classif.ksvm"),
  makeLearner("classif.randomForest")
)
lrn = makeModelMultiplexer(bls)
ps = makeModelMultiplexerParamSet(lrn,
  makeNumericParam("sigma", lower = -10, upper = 10, trafo = function(x) 2^x),
  makeIntegerParam("ntree", lower = 1L, upper = 500L))
> print(res)
Tune result:
**Op. pars: selected.learner=classif.randomForest; classif.randomForest.ntree=197
mmce.test.mean=0.0333**
+4
source share
1 answer

You have several options for this mlr. If you have one model, you can use BaggingWrapper :

lrn = makeLearner("classif.PART")
bag.lrn = makeBaggingWrapper(lrn, bw.iters = 50, bw.replace = TRUE, bw.size = 0.8, bw.feats = 3/4)

Read more about this in the tutorial .

For multiple students, you can use stacking :

base.learners = list(
  makeLearner("classif.ksvm"),
  makeLearner("classif.randomForest")
)
lrn = makeStackedLearner(base.learners, super.learner = NULL, predict.type = NULL,
  method = "stack.nocv", use.feat = FALSE, resampling = NULL,
  parset = list())

, . .

, mlr, . .

+5

Source: https://habr.com/ru/post/1625286/


All Articles