简体   繁体   English

mlr - 合奏模型

[英]mlr - Ensemble Models

The mlr package is great and idea of creating a ModelMultiplexer also helps. mlr包非常棒,创建ModelMultiplexer的想法也很有帮助。 But the ModelMultiplexer " selects " 1 single model out of the models used. 但ModelMultiplexer从所使用的模型中“ 选择 ”了1个单一模型。

Is there any support or planned support for creating a Bagged or Boosted Ensemble of the Individual Models? 是否有任何支持或计划支持创建单个模型的Bagged或Boosted Ensemble?

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**

You have a few options for this in mlr . mlr你有几个选择。 If you have a single model, you can use the BaggingWrapper : 如果你有一个型号,你可以使用BaggingWrapper

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

More details on this in the tutorial . 教程中有关于此的更多详细信息。

For several learners, 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())

You can combine the predictions of the base learners using different methods, including fitting another learner on top of them. 您可以使用不同的方法组合基础学习者的预测,包括在他们之上安装另一个学习者。 You can also combine this with bagging for the individual learners. 您还可以将其与个性化学习者的装袋相结合。

Boosting is supported in a number of the learners that mlr supports, see the list of all learners . mlr支持的许多学习者都支持Boosting,请参阅所有学习者列表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM