Skip to content

Instantly share code, notes, and snippets.

@danyashorokh
Last active October 5, 2017 08:58
Show Gist options
  • Save danyashorokh/486355b2eabed31637b990a2d57c2baa to your computer and use it in GitHub Desktop.
Save danyashorokh/486355b2eabed31637b990a2d57c2baa to your computer and use it in GitHub Desktop.
[Python] Tuning model params (GridSearchCV)
param_test1 = {'subsample': [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]}
gsearch1 = GridSearchCV(estimator = ensemble.GradientBoostingClassifier(n_estimators=600, learning_rate=0.04, max_depth=5,
max_leaf_nodes=5, random_state=2, min_samples_leaf=1, min_samples_split=300, max_features='sqrt', verbose=1, loss='exponential'),
param_grid=param_test1, scoring='roc_auc', n_jobs=4, iid=False, cv=5)
gsearch1.fit(X_train, y_train)
print(gsearch1.best_params_, gsearch1.best_score_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment