Grid Search
Perform the grid search to explore the best parametric values for our model.
The results in the previous lesson didn’t turn out to be good, and our model predicts all false results but can’t predict the ones that are true. SVM can do much better, even better than logistic regression and KNN in most of the cases. Let’s try the grid search and see if we can get an improved model. Now, another thing we need to explore is finding the best value of C
and gamma
parameters.
Grid search is one of the common ways to create a grid of parameters and try all the possible combinations to see which one works the best.
Scikit-learn has a built-in capability to implement grid search with GridSearchCV
. Essential members of GridSearchCV
are fit
and predict
. GridSearchCV
takes a model instance and a grid of the parameters defined as a dictionary. In the dictionary, keys are the parameters’ names, and the values are the settings ...