-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter 6, page 203 #113
Comments
Hi Germán, you are absolutely right. I think I listed this as two independent steps to make the general workflow/concept more clear (independent of scikit-learn). However, you can set |
Oh I see that the Edit: just clarified this in the notebook. Thanks! |
Thanks dear Sebastian for including a note about this in your third edition, I will close the issue :) |
Dear professor Sebastian,
I think there is no need to retrain the best estimator with the train set after using 'GridSearchCV', since the 'GridSearchCV' class already implements, by default (with the 'refit' param = True by default), a model re-training on the whole train dataset with the best found hyperparameters (based on the defined metric).
So in your example in this page, we could implement directly:
clf = gs.best_estimator_
--> this line would not be necessary: clf.fit(X_train, y_train)
print('Test accuracy: %.3f' % clf.score(X_test, y_test))
Test accuracy: 0.974
I hope I explained this clearly.
Best regards and thanks for your excellent book.
Germán
The text was updated successfully, but these errors were encountered: