Hyperparameter Tuning with GridSearchCV
GridSearchCV
will take a model and parameters and train one model for each permutation of the parameters. At the end of the training, it will provide access to the parameters and the model scores. This is called hyperparameter tuning and you will be looking at this in much more depth in Chapter 8, Hyperparameter Tuning.
The usual practice is to make use of a small training set to find the optimal parameters using hyperparameter tuning and then to train a final model with all of the data.
Before the next exercise, let's take a brief look at decision trees, which are a type of model or estimator.
Decision Trees
A decision tree works by generating a separating hyperplane or a threshold for the features in data. It does this by considering every feature and finding the correlation between the spread of the values in that feature and the label that you are trying to predict.
Consider the following data about balloons. The...