gluonts.model.seasonal_naive 包#
- class gluonts.model.seasonal_naive.SeasonalNaivePredictor(prediction_length: int, season_length: Union[int, Callable], imputation_method: gluonts.transform.feature.MissingValueImputation = gluonts.transform.feature.LastValueImputation())[源码]#
继承自:
gluonts.model.predictor.RepresentablePredictor
季节性朴素预测器。
对于每个时间序列 \(y\),此预测器生成预测 \(\tilde{y}(T+k) = y(T+k-h)\),其中 \(T\) 是预测时间,\(k = 0, ...,\) prediction_length - 1,而 \(h =\) season_length。
如果 prediction_length > season_length,则季节会被重复多次。如果时间序列短于 season_length,则使用观测值的平均值作为预测。
- 参数
prediction_length – 要预测的时间点数量。
season_length – 用于进行预测的季节性。如果这是整数,则应用固定的季节性;如果这是函数,则将对每个给定条目的
"start"
字段的freq
属性调用此函数,并返回要使用的季节性。imputation_method – 在存在缺失值时使用的填充方法。默认为
LastValueImputation
,它将每个缺失值替换为最后一个非缺失值。
- predict_item(item: Dict[str, Any]) gluonts.model.forecast.Forecast [源码]#