Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: 'ARIMAResults' object has no attribute 'plot_predict'

I'm running this code using sm.tsa.arima.ARIMA on my time series data

model = sm.tsa.arima.ARIMA(df.Sales, order=(1,1,1))
model_fit = model.fit()
print(model_fit.summary())

# Actual vs Fitted
model_fit.plot_predict(dynamic=False)
plt.show()

When I tried to plot the results, it gave me this error:

'ARIMAResults' object has no attribute 'plot_predict'

My version of statsmodels.__version__ is '0.13.2'

like image 822
MohammedE Avatar asked Mar 05 '26 11:03

MohammedE


1 Answers

Statsmodels version 13 removed the .plot_predict() method from the ARIMA classes. Hence, you only need to use plot_predict() that you already imported into your code. Here is an example:

plot_predict(model_fit, dynamic=False)
plt.show()
like image 87
Abdolamir Karbalaie Avatar answered Mar 07 '26 01:03

Abdolamir Karbalaie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!