A More Convenient Approach to Cross-Validation
Learn to use the GridSearchCV in scikit-learn for hyperparameter tuning.
We'll cover the following...
Advantages of using GridSearchCV
In the “The Bias-Variance Trade-Off” chapter, we gained a deep understanding of cross-validation by writing our own function to do it, using the KFold class to generate the training and testing indices. This was helpful to get a thorough understanding of how the process works. However, scikit-learn offers a convenient class that can do more of the heavy lifting for us: GridSearchCV. The GridSearchCV class can take as input a model that we want to find optimal hyperparameters for, such as a decision tree or a logistic regression, and a “grid” of ...
Ask