I've been trying to figure out how is the best_score_ parameter of GridSearchCV is being calculated (or in other words, what does it mean). The documentation says:
Score of best_estimator on the left out data.
So, I tried to translate it into something I understand and calculated the r2_score of the actual "y"s and the predicted ys of each kfold - and got different results (used this piece of code):
test_pred = np.zeros(y.shape) * np.nan
for train_ind, test_ind in kfold:
clf.best_estimator_.fit(X[train_ind, :], y[train_ind])
test_pred[test_ind] = clf.best_estimator_.predict(X[test_ind])
r2_test = r2_score(y, test_pred)
I've searched everywhere for a more meaningful explanation of the best_score_ and couldn't find anything. Would anyone care to explain?
Thanks