LoginSignup
0
2

More than 1 year has passed since last update.

アンサンブル学習-ブースティング(Boosting)

Posted at

ブースティング(Boosting)とは

ブースティング(Boosting)とは、複数の弱学習器を組み合わせて強学習器を形成するアンサンブル手法です。
弱学習器は、ランダムな推測よりもわずかに良い結果を出すモデルのことです。例えば、最大深度が1の決定木は弱学習器です。

ブースティングは、学習データもモデルも逐次的に生成・構築されていきます。
予測から外したサンプルが、次のモデル構築の段階で重視されるように新しい学習データが生成されます。イメージは以下です。

image.png
引用:"Hands on Machine Learning with scikit-learn and Tensorflow." (2017) Géron, Aurélien.

ブースティングは学習不足(underfitting)時に効果的な手法と言われています。

AdaBoost

AdaBoostはAdaptive Boosting(適応型ブースティング)の略です。
以下はAdaBoostの実例です。

from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.metrics import roc_auc_score

dt = DecisionTreeClassifier(max_depth=2, random_state=1)
ada = AdaBoostClassifier(base_estimator=dt, n_estimators=180, random_state=1)

ada.fit(X_train, y_train)

y_pred_proba = ada.predict_proba(X_test)[:, 1]

ada_roc_auc = roc_auc_score(y_test, y_pred_proba)

print('ROC AUC score: {:.2f}'.format(ada_roc_auc))

出力:

ROC AUC score: 0.71
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2