plot_backtest

plot_backtest(forecast_df: pandas.core.frame.DataFrame, ts: TSDataset, segments: Optional[List[str]] = None, columns_num: int = 2, history_len: Union[int, Literal['all']] = 0, figsize: Tuple[int, int] = (10, 5))[source]

Plot targets and forecast for backtest pipeline.

This function doesn’t support intersecting folds.

Parameters
  • forecast_df (pandas.core.frame.DataFrame) – forecasted dataframe with timeseries data

  • ts (TSDataset) – dataframe of timeseries that was used for backtest

  • segments (Optional[List[str]]) – segments to plot

  • columns_num (int) – number of subplots columns

  • history_len (Union[int, Literal['all']]) – length of pre-backtest history to plot, if value is “all” then plot all the history

  • figsize (Tuple[int, int]) – size of the figure per subplot with one segment in inches

Raises
  • ValueError: – if history_len is negative

  • ValueError: – if folds are intersecting