Tuning hyperparameters with grid search
For the final section in this chapter, we'll look at grid search and work through an example, continuing with this rainfall data. If you're not familiar with the concept of grid search, it's a way to exhaustively check all reasonable combinations of hyperparameters against a performance indicator and choose the best combination to train your final model. With Prophet, you might decide to select the following hyperparameters and values:
With these parameters, a grid search will iterate through each unique combination, use cross-validation to calculate and save a performance metric, and then output the set of parameter values which resulted in the best performance.
Prophet does not have a grid search method the way, for example, sklearn
does. One is easy enough to build yourself in Python though, so let's see how to set it up. The first step is...