There's more...
When working with the statsmodels library, we can also use two different methods for forecasting. The first one is called predict. We need to specify the start and end of the prediction interval. We can use indices (in the case of the out of sample, start needs to be the first value after the last index of the training data), a string ('2019-03-15'), or a datetime type (pd.datetime(1990, 12, 25)). We should also specify typ -in case any differencing was done and we want to receive the forecasts in the original scale, we should use 'levels' as the value (the default is 'linear').
The second method—plot_predict—an extension of the first one. Additional parameters include plot_insample (indicates whether we want to plot the in-sample ...
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