auto_ts:如何更改auto_ts中的预测日期范围



我正在尝试使用auto_ts预测值库中,我传递的输入是一个日期格式,每个月的第一个日期,如20121-11-01而预测值的日期范围为每个月的最后日期,如20121-11-30.

是否有办法将预测值的日期范围更改为每个月的第一个日期?

您看到的问题是因为autots使用pandas数据帧来推断频率。

model = AutoTS(
forecast_length=21,
frequency='infer',
prediction_interval=0.9,
ensemble=None,
model_list="fast",  # "superfast", "default", "fast_parallel"
transformer_list="fast",  # "superfast",
drop_most_recent=1,
max_generations=4,
num_validations=2,
validation_method="backwards"
)

pandas默认为月间隔的月尾。要获得月的开始,可以使用frequency ='MS'来获得月的开始:

model = AutoTS(
forecast_length=21,
frequency='MS', # this is the change needed
...)

最新更新