From the course: Applied Machine Learning: Foundations
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Grid search
From the course: Applied Machine Learning: Foundations
Grid search
Up to this point, we've been looking at tuning a single hyperparameter, but a lot of these models have multiple hyperparameters. So how do we tune those? I'm going to show you one way to do that in this video, which is called grid search. You can think of grid search as brute forcing all of the different options for all of the parameters, and then tracking the scores for those and seeing which combinations do the best. So I'm going to start off here with our decision tree. Let's just train our basic out-of-the-box model. There it is. It has a score of 0.73. Again, we can look at this decision tree if we want to. Now what I'm going to do is I'm going to define some parameters that I want to train. And I'm going to look at max_depth, min_samples_split, and min_samples_leaf. So remember, max_depth is how deep the tree can go, min_samples_split is how many rows of data must there be in a node enabled to split that. Because that is a min, if you increase that, it makes it simpler. So if…