From the course: Machine Learning and AI Foundations: Value Estimations

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

The brute force solution: Grid search

The brute force solution: Grid search

- [Instructor] Two common problems in machines learning models are over fitting and under fitting. We can often fix either problem by adjusting the hyperparameters on our model. The problem is that machine learning models have lots of hyperparameters to adjust. Often the best way to find the best settings is just through trial and error, but it can take a lot of work to try all the possible combinations. Let's open up train_model.py. When we create our model, we pass in these parameters. We have six different parameters here that we can tune and most of these parameters accept any number, so we literally have an infinite number of combinations we could try. A solution for this problem is to use a grid search. A grid search is where you list out a range of settings you want to try for each parameter, and you literally try them all. You train and test the model for every combination of parameters. The combination of parameters that generates the best predictions are the set of…

Contents