アンサンブルとハイパーパラメータ調整

PythonでMachine Learningを使ってCTRを予測する

Kevin Huo

Instructor

アンサンブル手法

ブートストラップ集約の例

  • バギング: 複数モデルに異なるランダム標本を割り当て、個別に学習し、最後に統合します。
PythonでMachine Learningを使ってCTRを予測する

ランダムフォレスト

clf = RandomForestClassifier()
print(clf)
RandomForestClassifier(
  bootstrap=True,
  ...
  max_depth = 10,
  ...
  n_estimators = 100,
  ...)
PythonでMachine Learningを使ってCTRを予測する

ハイパーパラメータ調整

  • ハイパーパラメータ: 学習前に設定する、モデル外部のパラメータ
  • パラメータだがハイパーパラメータでない例: 線形回帰の傾き係数、ロジスティック回帰の重み など
  • ハイパーパラメータの例: max_depth, n_estimators など
PythonでMachine Learningを使ってCTRを予測する

グリッドサーチ

param_grid = {'n_estimators': n_estimators, 
              'max_depth': max_depth}
clf = GridSearchCV(estimator = model, 
                   param_grid = param_grid, 
                   scoring = 'roc_auc')
print(clf.best_score_)
print(clf.best_estimator_)
0.6777
RandomForestClassifier(max_depth = 100, ...)
PythonでMachine Learningを使ってCTRを予測する

演習しましょう!

PythonでMachine Learningを使ってCTRを予測する

Preparing Video For Download...