In the 10x series of notebooks, we will look at Time Series modeling in pycaret using univariate data and no exogenous variables. We will use the famous airline dataset for illustration. Our plan of action is as follows:
def what_is_installed():
from pycaret import show_versions
show_versions()
try:
what_is_installed()
except ModuleNotFoundError:
!pip install pycaret-ts-alpha
what_is_installed()
import time
import numpy as np
import pandas as pd
from pycaret.datasets import get_data
from pycaret.time_series import TSForecastingExperiment
y = get_data('airline', verbose=False)
# We want to forecast the next 12 months of data and we will use 3 fold cross-validation to test the models.
fh = 12 # or alternately fh = np.arange(1,13)
fold = 3
# Global Plot Settings
fig_kwargs={'renderer': 'notebook'}
pycaret
Time Series Forecasting module provides a conventient interface for perform exploratory analysis using plot_model
.
NOTE:
plot_model
will plot using the original dataset. We will cover this in the current notebook.plot_model
, the the plots are made using the model data (e.g. future forecasts, or analysis on insample residuals). We will cover this in a subsequent notebook.Let's see how this works next.
First, we will plots the original dataset.
eda = TSForecastingExperiment()
eda.setup(data=y, fh=fh, fig_kwargs=fig_kwargs)
# NOTE: This is the same as `eda.plot_model(plot="ts")`
eda.plot_model()