Module

pycaret.plots.time_series

Plotly-native time-series diagnostics.

Functions:

  • forecast — point predictions with optional confidence band against the actuals.
  • decomposition — additive/multiplicative trend / seasonal / residual via statsmodels' seasonal_decompose.
  • residual_diagnostics — 4-panel: residuals over time, histogram, ACF, PACF.
  • acf — autocorrelation function bar chart.
  • pacf — partial autocorrelation function bar chart.
  • cv_split_visualizer — visual of how an ExpandingWindowSplitter / SlidingWindowSplitter carves the series into train/test folds.

Functions 6

forecast(y_true: Any, y_pred: Any, lower: Any | None = None, upper: Any | None = None, history: Any | None = None, title: str | None = 'Forecast') -> go.Figure

Forecast vs. actuals with optional CI band.

Parameters#

y_true : actuals over the forecast horizon (or None for no ground truth) y_pred : point predictions lower / upper : prediction interval bounds (same index as y_pred) history : training-period series shown before the forecast (optional)

decomposition(y: Any, period: int | None = None, model: str = 'additive', title: str | None = 'Seasonal decomposition') -> go.Figure

Trend / seasonal / residual decomposition via statsmodels.

Parameters#

y : series with a regular time index period : seasonal period (e.g. 12 for monthly with yearly seasonality);

inferred from `y.index.freqstr` when omitted

model : "additive" (default) or "multiplicative"

acf(y: Any, nlags: int = 40, alpha: float = 0.05, title: str | None = 'Autocorrelation') -> go.Figure

Autocorrelation function bar chart with confidence interval band.

Use to spot seasonality (peaks at lag = period) and residual correlation (residuals shouldn't have peaks).

pacf(y: Any, nlags: int = 40, alpha: float = 0.05, title: str | None = 'Partial autocorrelation') -> go.Figure

Partial autocorrelation — same shape as acf but conditioning on the intermediate lags.

residual_diagnostics(y_true: Any, y_pred: Any, nlags: int = 30, title: str | None = 'Residual diagnostics') -> go.Figure

4-panel residual diagnostics for forecasts:

  1. Residuals over time.
  2. Residuals histogram with mean line.
  3. ACF of residuals.
  4. PACF of residuals.

A well-behaved forecast has near-zero mean residuals, no time pattern, and ACF/PACF within the CI band.

cv_split_visualizer(fold_generator: Any, y: Any, title: str | None = 'CV folds') -> go.Figure

Visualize how an sktime splitter carves the training series.

Each fold is a row; train indices are accent-colored, test indices are red. Useful for spotting splitter misconfigurations.