Predicting CTR with Machine Learning in Python
Kevin Huo
Instructor
clf = RandomForestClassifier()
print(clf)
RandomForestClassifier(
bootstrap=True,
...
max_depth = 10,
...
n_estimators = 100,
...)
max_depth
, n_estimators
, etc.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, ...)
Predicting CTR with Machine Learning in Python