Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
params = {'n_estimators':[500, 1000, 1500, 2000], 'max_depth':[3, 5, 8]}
gbr = GradientBoostingRegressor()
gbr_grid = GridSearchCV(gbr, params, cv=5)
gbr_grid.fit(X_train, Y_train)
print("Grid Search Gradient Boosting Score: ", gbr_grid.score(X_train, Y_train))
print("Grid Search Gradient Boosting Test Score: ", gbr_grid.score(X_test, Y_test))
print("Grid Search Gradient Boosting Best Parameters: ", gbr_grid.best_params_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.