在对 Prophet 模型执行交叉验证时,我遇到了一个错误:不再支持单位“M”、“Y”和“y”,因为它们不代表明确的 timedelta 值持续时间。
代码:
model=Prophet()
model.fit(df)
forecast=model.make_future_dataframe(periods=14,freq='A)
future=model.predict(forecast)
from prophet.diagnostics import cross_validation
dataframe_crossvalidation=cross_validation(model,initial=pd.to_timedelta(42,unit="Y"),
period=pd.to_timedelta(7,unit="Y"),horizon=pd.to_timedelta(14,unit="Y"))
**error: Units 'M', 'Y', and 'y' are no longer supported, as they do not represent unambiguous
timedelta values durations**
有关如何解决此问题的任何建议?