scikit-learn : Machine Learning Simplified
by Raúl Garreta, Guillermo Moncecchi, Trent Hauck, Gavin Hackeling
Tuning models with grid search
Hyperparameters are parameters of the model that are not learned. For example, hyperparameters of our logistic regression SMS classifier include the value of the regularization term and thresholds used to remove words that appear too frequently or infrequently. In scikit-learn, hyperparameters are set through the model's constructor. In the previous examples, we did not set any arguments for LogisticRegression(); we used the default values for all of the hyperparameters. These default values are often a good start, but they may not produce the optimal model. Grid search is a common method to select the hyperparameter values that produce the best model. Grid search takes a set of possible values for each hyperparameter ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access