etna.analysis.plot_residuals#
- plot_residuals(forecast_ts_list: List[TSDataset], ts: TSDataset, feature: str | Literal['timestamp'] = 'timestamp', transforms: Sequence[Transform] = (), segments: List[str] | None = None, columns_num: int = 2, figsize: Tuple[int, int] = (10, 5))[source]#
Plot residuals for predictions from backtest against some feature.
- Parameters:
forecast_ts_list (List[TSDataset]) – List of TSDataset with forecast for each fold from backtest
ts (TSDataset) – dataframe of timeseries that was used for backtest
feature (str | Literal['timestamp']) – feature name to draw against residuals, if “timestamp” plot residuals against the timestamp
transforms (Sequence[Transform]) – sequence of transforms to get feature column
columns_num (int) – number of columns in subplots
figsize (Tuple[int, int]) – size of the figure per subplot with one segment in inches
- Raises:
ValueError: – if feature isn’t present in the dataset after applying transformations
Notes
Parameter
transforms
is necessary because some pipelines doesn’t save features in their forecasts, e.g.etna.ensembles
pipelines.