用来预测商店销售量的阿利马模型 使用Stats models.tsa.arima. model. Arima模型来预测商店销售量
from statsmodels.tsa.arima.model import ARIMA
from datetime import datetime
# fit model
model = ARIMA(ts, order=(1,0,1))
model_fit = model.fit()
# predict
start_index = datetime(2024, 1, 1)
end_index = datetime(2024, 5, 1)
# model_fit.predict(start=start_index, end=end_index)
forecast = model_fit.predict(start = "2024-01-01", end = "2024-05-01")
However, it just shows ValueError: Prediction must have `end` after `start`.
Is there anyone having the same issue as well?
ts is a dataframe with two columns, date(index, from 2021/01/01 to 2024/05/02) and gmv
date gmv
2021-01-01 155629555
2021-01-02 161346990
...
...
2024-01-01 192776022
...
2024-05-01 207816942
2024-05-02 217788026