Parameter Searching

In this lesson, learn how to do parameter searching in sklearn.

We'll cover the following...

Fine-tuning parameters is an important part of a Machine Learning project, especially in Deep Learning. Although this course focuses on traditional Machine Learning, a few parameters need to be adjusted and the parameter space is limited. However, some models still require lots of parameters, such as a tree-based model.

In practice, people fine-tune by hand. They try a series of values for one parameter, evaluate models, and then choose the best one. If there are more than two parameters, they repeat the process until all parameters are chosen. The process is time-consuming and tedious and it can be completely automated.

sklearn provides some useful functions to help us. In this lesson, we will only focus on the GridSearchCV. The principle is similar in other ways.

Grid Search

The grid search provided by GridSearchCV exhaustively generates candidates from a grid of parameter values specified with the param_grid parameter. In this example, we work on the tree-based model that has lots of parameters.

Let’s skip the data loading and splitting part, we’ll jump to ...