Python/Machine Learning:我可以将几个预测模型组合到on中吗

2024-04-27 05:14:14 发布

您现在位置:Python中文网/ 问答频道 /正文

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

我试过了,但有个错误:

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

错误:

^{pr2}$

有办法吗?(有比装袋更简单的方法吗?)在


Tags: 模型算法targettimemodels错误森林val
1条回答
网友
1楼 · 发布于 2024-04-27 05:14:14

使用VotingClassifier。在

The idea behind the voting classifier implementation is to combine conceptually different machine learning classifiers and use a majority vote or the average predicted probabilities (soft vote) to predict the class labels.

相关问题 更多 >