Since _grid_scores_ method has been replaced by cv_results_ I would like to know how do I output the tuple with the parameters and scores? cv_results_ provides a dataframe for the score, but the tuple output was way easier to handle.
Please guide me towards handling parameter and score values in this new version of scikit. I plan to run a GridSearchCV for different ranges of parameters which I would latter consolidate into a single dictionary.
Use the for loop
to print the results from cv_results_
as they were in grid_scores_
.
From the documentation example:
clf = GridSearchCV(init params...)
clf.fit(train data...)
print("Best parameters set found on development set:")
print(clf.best_params_)
print("Grid scores on development set:")
means = clf.cv_results_['mean_test_score']
stds = clf.cv_results_['std_test_score']
#THIS IS WHAT YOU WANT
for mean, std, params in zip(means, stds, clf.cv_results_['params']):
print("%0.3f (+/-%0.03f) for %r"
% (mean, std * 2, params))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With