Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created November 12, 2020 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/ccf48c11291895064d2973049293a397 to your computer and use it in GitHub Desktop.
Save amankharwal/ccf48c11291895064d2973049293a397 to your computer and use it in GitHub Desktop.
grid = GridSearchCV(estimator=model, param_grid=param_grid, n_jobs=-1)
grid_result = grid.fit(X_train, y_train)
print("Best: %f using %s" % (grid_result.best_score_, grid_result.best_params_))
means = grid_result.cv_results_['mean_test_score']
stds = grid_result.cv_results_['std_test_score']
params = grid_result.cv_results_['params']
for mean, stdev, param in zip(means, stds, params):
print("%f (%f) with: %r" % (mean, stdev, param))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment