Ensembles und Hyperparameter-Tuning

CTR-Vorhersage mit Machine Learning in Python

Kevin Huo

Instructor

Ensemble-Methoden

Beispiel für Bootstrap-Aggregation

  • Bagging: Zufallsstichproben für verschiedene Modelle; Modelle einzeln trainieren und dann kombinieren.
CTR-Vorhersage mit Machine Learning in Python

Random Forests

clf = RandomForestClassifier()
print(clf)
RandomForestClassifier(
  bootstrap=True,
  ...
  max_depth = 10,
  ...
  n_estimators = 100,
  ...)
CTR-Vorhersage mit Machine Learning in Python

Hyperparameter-Tuning

  • Hyperparameter: Einstellungen vor dem Training, außerhalb des Modells
  • Beispiele für Parameter, aber keine Hyperparameter: Steigungskoeffizient in linearer Regression, Gewichte in logistischer Regression usw.
  • Beispiele für Hyperparameter: max_depth, n_estimators usw.
CTR-Vorhersage mit Machine Learning in Python

Grid Search

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, ...)
CTR-Vorhersage mit Machine Learning in Python

Lass uns üben!

CTR-Vorhersage mit Machine Learning in Python

Preparing Video For Download...