naive.snaive()

Fit Seasonal Naive model and generate forecast.

Usage

Source

naive.snaive(
    train,
    params,
    test=None,
    horizon=None,
)

Parameters

train: pd.DataFrame

Historic training data.

params: SNaiveParams

Parameters controlling the model.

test: pd.DataFrame | None = None

Data containing the dates to forecast in a ds column. Typically a held-out test set or cross-validation fold.

horizon: int | None = None
Number of days to forecast, after the final date in train. To be used if there is no test set (e.g., if actually predicting into future with no data to compare against).

Returns

pd.DataFrame
Forecast dataframe.