5.2. Grid Search¶
Grid Search is used to optimize the parameters of a model (e.g. Support Vector Classifier, Lasso, etc.) using cross-validation.
Main class is GridSearchCV.
5.2.1. Examples¶
See Parameter estimation using grid search with a nested cross-validation for an example of Grid Search computation on the digits dataset.
See Sample pipeline for text feature extraction and evaluation for an example of Grid Search coupling parameters from a text documents feature extractor (n-gram count vectorizer and TF-IDF transformer) with a classifier (here a linear SVM trained with SGD with either elastic net or L2 penalty).
5.2.2. Notes¶
Computations can be run in parallel if your OS supports it, by using the keyword n_jobs=-1, see function signature for more details.