【问题标题】:Ensemble method, what should I do?集成方法,我该怎么办?
【发布时间】:2021-10-05 13:59:17
【问题描述】:

请问,为什么 Ensemble 学习中的估算器功能在 python 3 中不起作用?

StackingClassifier(estimators=base_learners, final_estimator=LogisticRegression())

TypeError: __init__() got an unexpected keyword argument 'estimators'

那是错误。

提前致谢。

【问题讨论】:

  • 你能提供你正在使用的代码吗?
  • 很明显你有一个不期望的关键字参数,但是没有更多上下文就没有帮助

标签: python-3.x ensemble-learning


【解决方案1】:

由于您收到 TypeError,您可能向函数传递了不正确的数据类型。假设您使用的是 sklearn.ensemble.StackingClassifier (docs),它需要一个 (str, estimator) 元组列表。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-04
    • 2011-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多