1. Learn
  2. /
  3. Courses
  4. /
  5. Linear Classifiers in Python

Connected

Exercise

GridSearchCV warm-up

In the video we saw that increasing the RBF kernel hyperparameter gamma increases training accuracy. In this exercise we'll search for the gamma that maximizes cross-validation accuracy using scikit-learn's GridSearchCV. A binary version of the handwritten digits dataset, in which you're just trying to predict whether or not an image is a "2", is already loaded into the variables X and y.

Instructions

100 XP
  • Create a GridSearchCV object.
  • Call the fit() method to select the best value of gamma based on cross-validation accuracy.