class_docstr: Seasonal naïve forecaster.
  
  For each time series :math:`y`, this predictor produces a forecast
  :math:`\tilde{y}(T+k) = y(T+k-h)`, where :math:`T` is the forecast time,
  :math:`k = 0, ...,` `prediction_length - 1`, and :math:`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.
  
  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 :py:class:`LastValueImputation` which replaces each missing
      value with the last value that was not missing.
class_docstr_tok: ["Seasonal","na\u00efve","forecaster",".","For","each","time","series",":","math",":","`","y","`",",","this","predictor","produces","a","forecast",":","math",":","`","\\tilde","{","y","}","(","T+k",")","=","y","(","T+k-h",")","`",",","where",":","math",":","`","T","`","is","the","forecast","time",",",":","math",":","`","k","=","0",",","...",",","`","`","prediction_length","-","1","`",",","and",":","math",":","`","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",".","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",":","py",":","class",":","`","LastValueImputation","`","which","replaces","each","missing","value","with","the","last","value","that","was","not","missing","."]
code: def __init__(
      self,
      prediction_length: int,
      season_length: Union[int, Callable],
      imputation_method: MissingValueImputation = LastValueImputation(),
  ) -> None:
      super().__init__(prediction_length=prediction_length)
  
      assert (
          not isinstance(season_length, int) or season_length > 0
      ), "The value of `season_length` should be > 0"
  
      self.prediction_length = prediction_length
      self.season_length = season_length
      self.imputation_method = imputation_method
  
file_path: gluonts/src/gluonts/model/seasonal_naive/_predictor.py
imports: from typing import Callable, Union
  import numpy
  from gluonts.core.component import validated
  from gluonts.dataset.common import DataEntry
  from gluonts.dataset.util import forecast_start
  from gluonts.dataset.field_names import FieldName
  from gluonts.model.forecast import Forecast, SampleForecast
  from gluonts.model.predictor import RepresentablePredictor
  from gluonts.transform.feature import LastValueImputation, MissingValueImputation
label_desc: Use image node_id 1 to create a new SeasonalNaivePredictor object from inherited base classes: RepresentablePredictor with example: obj = SeasonalNaivePredictor(prediction_length, season_length, imputation_method)