2016-05-07 12 views
2

予測モデルを作成していて、当初はランダムフォレストアルゴリズムを使用していました。さまざまな予測アルゴリズムを組み合わせて精度を向上させたいと考えています。 Python/Machine Learning:複数の予測モデルを1つに結合することはできますか?

は、私はこれを試してみましたが、私はエラーを取得:

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 

これを行う方法はありますか? (袋詰めより簡単な方法はありますか?)

答えて

3

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.

関連する問題