AttributeError:“tuple”对象没有“predicted_mean”属性

2024-09-24 00:35:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我的代码是关于预测时间序列数据的

pred_uc = model_fit.forecast(steps=50)
# Get confidence intervals of forecasts
#pred_ci = pred_uc.conf_int()

我试图在Python上使用ARIMA可视化预测的数据,下面是我的代码

 ax = df['spei'].plot(label='observed', figsize=(20, 15))
 pred_uc.predicted_mean.plot(ax=ax, label='Forecast')
 #ax.fill_between(pred_ci.index,
           # pred_ci.iloc[:, 0],
          #  pred_ci.iloc[:, 1], color='k', alpha=.25)
 ax.set_xlabel('Date')
 ax.set_ylabel('spei')

 plt.legend()
 plt.show()

我犯了这个错误

AttributeError: 'tuple' object has no attribute 'predicted_mean'

请帮帮我


Tags: 数据代码ciplot时间pltaxmean