问题描述
我有这个数据集:
dt_inter count
2015-01-01 218.0
2015-01-02 12.0
2015-01-03 4.0
2015-01-04 2.0
2015-01-05 5.0
... ...
2018-12-27 9903.0
2018-12-28 7599.0
2018-12-29 3944.0
2018-12-30 1694.0
2018-12-31 270.0
1461 rows × 1 columns
我分为:
data_train = g.loc['2015-01-01':'2017-12-31']
data_test = g.loc['2018-01-01':]
尝试统计模型ARIMA:
model = ARIMA(data_train,order=(1,1,1)) # Note that the order here was a guess
model_fit = model.fit(disp=0)
res = model_fit.plot_predict()
很好,但是使用测试数据时:
plt.plot(model_fit.predict(start=data_test.index[0],end=data_test.index[-1]))
尝试使用自动别名:
model = auto_arima(data_train,start_p=1,start_q=1,max_p=3,max_q=3,m=7,# 7 for daily data,12 for monthly,1 for yearly
start_P=0,seasonal=True,d=1,D=1,trace=True,error_action='ignore',suppress_warnings=True,stepwise=True)
最佳模型:ARIMA(2,0)(1,0)[7]
总合身时间:38.228秒
forecast = model.predict(n_periods=365)
plt.plot(forecast)
我在做什么错了?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)