Tuning Using Grid Search
In the context of machine learning, grid search refers to a strategy of systematically testing out every hyperparameterization from a pre-defined set of possibilities for your chosen estimator. You decide the criteria used to evaluate performance, and once the search is complete, you may manually examine the results and choose the best hyperparameterization, or let your computer automatically choose it for you.
The overall objective is to try and find an optimal hyperparameterization that leads to improved performance when predicting unseen data.
Before we get to the implementations of grid search in scikit-learn, let's first demonstrate the strategy using simple Python for
loops.
Simple Demonstration of the Grid Search Strategy
In the following demonstration of the grid search strategy, we will use the breast cancer prediction dataset we saw in Exercise 8.01, where we manually tuned the hyperparameters of the k-NN classifier to optimize...