August 2019
Intermediate to advanced
342 pages
9h 35m
English
The following example shows how to use the GridSearchCV class, available in the sklearn.model_selection package, to perform the hyperparameter optimization of a classifier using cross validation (please refer to the Algorithms Cross Validation paragraph of Chapter 9, Evaluating Algorithms, for the explanation of cross validation).
We use the digit sample dataset that comes with the scikit-learn library.
The dataset is equally divided into training subset and testing subset, using the train_test_split() method, which is assigned the test_size=0.5 parameter.
The different performances of the support vector classifier (SVC) are then compared—in consequence of fine tuning the precision and recall metrics ...
Read now
Unlock full access