相关疑难解决方法(0)

在 Sklearn 管道中使用 VotingClassifier

我想将投票分类器应用于多个管道分类器并在网格搜索中调整参数。以下最小示例给了我一个错误。我必须以不同的方式做这件事吗?

from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import VotingClassifier
p1 = Pipeline([['clf1', RandomForestClassifier()]])
p2 = Pipeline([['clf2', AdaBoostClassifier()]])
p3 = Pipeline([['clf3', VotingClassifier(estimators=(p1, p2))]])
p3.get_params()
Run Code Online (Sandbox Code Playgroud)

错误:

TypeError: cannot convert dictionary update sequence element #0 to a sequence
Run Code Online (Sandbox Code Playgroud)

python machine-learning scikit-learn

2
推荐指数
1
解决办法
3009
查看次数

标签 统计

machine-learning ×1

python ×1

scikit-learn ×1