forecast.run_single_forecast()

Run a forecast for one metric and area.

Usage

Source

forecast.run_single_forecast(
    forecast_function,
    train,
    params,
    metric,
    area,
    test=None,
    horizon=None,
    seed_parts=None
)

Filters the full training and optional test datasets to one metric/area series and runs the selected forecasting function.

Parameters

forecast_function: prophet | arima | snaive

Forecasting function to run.

train: pd.DataFrame

Historic data used to train the model.

params: ProphetParams | ARIMAParams | SNaiveParams | dict

Parameters for the selected forecasting model. Can be one parameter object used for all metrics, or a dictionary mapping metric names to parameter objects.

metric: str

Name of metric to forecast.

area: str

Name of area to forecast.

test: pd.DataFrame = None

Held-out data to forecast and later compare against. If None, provide horizon instead,

horizon: int = None

Number of days to forecast after the final training date. If None, provide test instead.

seed_parts: tuple | None = None
Values used to create a deterministic random seed for Prophet. Ignored for forecasting functions other than Prophet.

Returns

forecast: pd.DataFrame
Forecast results.