我正在对Kaggle的MonthlyBeerproduction数据集进行以下时间序列分析:
Month Monthly beer production
1956-01-01 93.2
1956-02-01 96.0
1956-03-01 95.2
1956-04-01 77.1
1956-05-01 70.9
应用ARIMA模型后,尝试预测值时,它显示以下错误。有人可以指出我要去哪里了吗?预先感谢。
TypeError跟踪(最近一次通话最近) 在 ----> 1 m1 = model.predict(train_data) 2平方米
〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ base \ wrapper.py在包装器中(self,* args,** kwargs) 93 obj = data.wrap_output(func(results,* args,** kwargs),how [0],how [1:]) 94 Elif如何: ---> 95 obj = data.wrap_output(func(结果,* args,** kwargs),怎么做) 96返回obj 97
〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ tsa \ arima_model.py在预测中(self,start,end,exog,typ,dynamic) 1816 defpredict(self,start = None,end = None,exog = None,typ ='linear', 1817 dynamic = False): -> 1818返回self.model.predict(self.params,开始,结束,exog,Typ,动态) 1819预言。 doc = _arima_results_predict 1820
〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ tsa \ arima_model.py在预测中(self,params,start,end,exog,typ,dynamic) 1173开始不为无): 1174 return super(ARIMA,self).predict(参数,开始,结束,exog, -> 1175动态) 1176其他: 1177#需要假设样本前残差为零
〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ tsa \ arima_model.py在预测中(self,params,start,end,exog,dynamic) 709#将返回日期索引 第710章 -> 711 self._get_prediction_index(开始,结束,动态) 712 713 if out_of_sample and(exog为None且self.k_exog> 0):
〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ tsa \ arima_model.py在_get_prediction_index中(自身,开始,结束,动态,索引) 1051 1052开始,结束,out_of_sample,prediction_index =( -> 1053超级(ARIMA,自身)._ get_prediction_index(开始,结束,索引)) 1054 1055#来自_get_predict_end
〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ tsa \ arima_model.py在_get_prediction_index中(自身,开始,结束,动态,索引) 641 642开始,结束,out_of_sample,prediction_index =( -> 643超级(ARMA,自身)._ get_prediction_index(开始,结束,索引)) 644 645#这代替了_validate()调用
_get_prediction_index中的〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ tsa \ base \ tsa_model.py(self,start,end,index,silent)
520#索引。
521尝试:
-> 522开始,start_index,start_oos = self._get_index_label_loc(开始)
523(KeyError除外):
524引发KeyError('start
参数无法与a匹配
〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ tsa \ base \ tsa_model.py in _get_index_label_loc(self,key,base_index) 420尝试: 第421章 -> 422 self._get_index_loc(key,base_index)) 423除了KeyError为e: 424尝试:
〜\ Anaconda3 \ lib \ site-packages \ statsmodels \ tsa \ base \ tsa_model.py in _get_index_loc(self,key,base_index) 336 date_key = Period(键,freq = base_index.freq) 337: -> 338 date_key =时间戳记(key) 339 340#样本外
pandas中的pandas / _libs / tslibs / timestamps.pyx._libs.tslibs.timestamps.Timestamp。新()
pandas中的pandas / _libs / tslibs / conversion.pyx._libs.tslibs.conversion.convert_to_tsobject()
TypeError:无法转换输入[每月啤酒产量
月
1956-01-01 93.2
1956-02-01 96.0
1956-03-01 95.2
1956-04-01 77.1
1956-05-01 70.9
1956-06-01 64.8
1956-07-01 70.1
1956-08-01 77.3
1956-09-01 79.5
1956-10-01 100.6
1956-11-01 100.7
1956-12-01 107.1
1957-01-01 95.9
1957-02-01 82.8
1957-03-01 83.3
1957-04-01 80.0
1957-05-01 80.4
1957-06-01 67.5
1957-07-01 75.7
1957-08-01 71.1
1957-09-01 89.3
1957-10-01 101.1
1957-11-01 105.2
1957-12-01 114.1
1958-01-01 96.3
1958-02-01 84.4
1958-03-01 91.2
1958-04-01 81.9
1958-05-01 80.5
1958-06-01 70.4
……
1992-02-01 133.0
1992-03-01 163.0
1992-04-01 150.0
1992-05-01 129.0
1992-06-01 131.0
1992-07-01 145.0
1992-08-01 137.0
1992-09-01 138.0
1992-10-01 168.0
1992-11-01 176.0
1992-12-01 188.0
1993-01-01 139.0
1993-02-01 143.0
1993-03-01 150.0
1993-04-01 154.0
1993-05-01 137.0
1993-06-01 129.0
1993-07-01 128.0
1993-08-01 140.0
1993-09-01 143.0
1993-10-01 151.0
1993-11-01 177.0
1993-12-01 184.0
1994-01-01 151.0
1994-02-01 134.0
1994-03-01 164.0
1994-04-01 126.0
1994-05-01 131.0
1994-06-01 125.0
1994-07-01 127.0
[463行x 1列]]类型为时间戳