utils

Functions

_get_existing_quantiles(ts)

Get quantiles that are present inside the TSDataset.

_prepare_forecast_results(forecast_ts)

Prepare dictionary with forecasts results.

_select_quantiles(forecast_results, quantiles)

Select quantiles from the forecast results.

_validate_intersecting_segments(fold_numbers)

Validate if segments aren't intersecting.

get_residuals(forecast_df, ts)

Get residuals for further analysis.

get_residuals(forecast_df: pandas.core.frame.DataFrame, ts: TSDataset) TSDataset[source]

Get residuals for further analysis.

Function keeps hierarchy, features in result dataset and removes target components.

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

  • ts (TSDataset) – dataset of timeseries that has answers to forecast

Returns

TSDataset with residuals in forecasts

Return type

new_ts

Raises

KeyError: – if segments of forecast_df and ts aren’t the same