TimeSeriesPredictor.plot

TimeSeriesPredictor.plot(data: TimeSeriesDataFrame | DataFrame | Path | str, predictions: TimeSeriesDataFrame | None = None, quantile_levels: List[float] | None = None, item_ids: List[str | int] | None = None, max_num_item_ids: int = 8, max_history_length: int | None = None, point_forecast_column: str | None = None, matplotlib_rc_params: dict | None = None)[source]

Plot historical time series values and the forecasts.

Parameters:
  • data (Union[TimeSeriesDataFrame, pd.DataFrame, Path, str]) – Observed time series data.

  • predictions (TimeSeriesDataFrame, optional) – Predictions generated by calling predict().

  • quantile_levels (List[float], optional) – Quantile levels for which to plot the prediction intervals. Defaults to lowest & highest quantile levels available in predictions.

  • item_ids (List[Union[str, int]], optional) – If provided, plots will only be generated for time series with these item IDs. By default (if set to None), item IDs are selected randomly. In either case, plots are generated for at most max_num_item_ids time series.

  • max_num_item_ids (int, default = 8) – At most this many time series will be plotted by the method.

  • max_history_length (int, optional) – If provided, at most this many time steps will be shown for each time series in data.

  • point_forecast_column (str, optional) – Name of the column in predictions that will be plotted as the point forecast. Defaults to "0.5", if this column is present in predictions, otherwise "mean".

  • matplotlib_rc_params (dict, optional) – Dictionary describing the plot style that will be passed to [matplotlib.pyplot.rc_context](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.rc_context.html). See [matplotlib documentation](https://matplotlib.org/stable/users/explain/customizing.html#the-default-matplotlibrc-file) for the list of available options.