gluonts.model.seasonal_naive package#
- class gluonts.model.seasonal_naive.SeasonalNaivePredictor(prediction_length: int, season_length: Union[int, Callable], imputation_method: gluonts.transform.feature.MissingValueImputation = gluonts.transform.feature.LastValueImputation())[source]#
Bases:
gluonts.model.predictor.RepresentablePredictor
Seasonal naïve forecaster.
For each time series
, this predictor produces a forecast , where is the forecast time, prediction_length - 1, and season_length.If prediction_length > season_length, then the season is repeated multiple times. If a time series is shorter than season_length, then the mean observed value is used as prediction.
- Parameters
prediction_length – Number of time points to predict.
season_length – Seasonality used to make predictions. If this is an integer, then a fixed sesasonlity is applied; if this is a function, then it will be called on each given entry’s
freq
attribute of the"start"
field, and will return the seasonality to use.imputation_method – The imputation method to use in case of missing values. Defaults to
LastValueImputation
which replaces each missing value with the last value that was not missing.
- predict_item(item: Dict[str, Any]) gluonts.model.forecast.Forecast [source]#