【问题标题】:Python/Machine Learning: Can I combine several prediction models into onePython/机器学习:我可以将几个预测模型合二为一吗
【发布时间】:2016-09-02 14:55:46
【问题描述】:

我正在研究一个预测模型,最初使用的是随机森林算法。我想将不同的预测算法组合成一个来提高我的准确性。

我试过这个,但我得到一个错误:

models = [RandomForestClassifier(n_estimators=200), GradientBoostingClassifier(n_estimators=100)]
%time cross_val_score(models, X2, Y_target).mean()

错误:

estimator should a be an estimator implementing 'fit' method

有没有办法做到这一点? (有没有比 bagging 更简单的方法?)

【问题讨论】:

    标签: python model machine-learning classification


    【解决方案1】:

    使用VotingClassifier

    投票分类器实现背后的想法是结合 概念上不同的机器学习分类器并使用多数 投票或平均预测概率(软投票)来预测 类标签。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-09
      • 2012-09-02
      • 2018-06-03
      • 2020-03-01
      • 2020-03-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多