Table Of Contents
Table Of Contents

gluonts.model.seasonal_naive package

class gluonts.model.seasonal_naive.SeasonalNaiveEstimator(**kwargs)[source]

Bases: gluonts.model.estimator.DummyEstimator

An estimator that, upon train, simply returns a pre-constructed. SeasonalNaivePredictor.

Parameters:kwargs – Arguments to pass to the SeasonalNaivePredictor constructor.
class gluonts.model.seasonal_naive.SeasonalNaivePredictor(freq: str, prediction_length: int, season_length: Optional[int] = None)[source]

Bases: gluonts.model.predictor.RepresentablePredictor

Seasonal naïve forecaster.

For each time series \(y\), this predictor produces a forecast \(\tilde{y}(T+k) = y(T+k-h)\), where \(T\) is the forecast time, \(k = 0, ...,\) prediction_length - 1, and \(h =\) 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.

  • freq – Frequency of the input data
  • prediction_length – Number of time points to predict
  • season_length – Length of the seasonality pattern of the input data
predict(dataset: gluonts.dataset.common.Dataset, **kwargs) → Iterator[gluonts.model.forecast.SampleForecast][source]

Compute forecasts for the time series in the provided dataset. This method is not implemented in this abstract class; please use one of the subclasses.

Parameters:dataset – The dataset containing the time series to predict.
Returns:Iterator over the forecasts, in the same order as the dataset iterable was provided.
Return type:Iterator[Forecast]