AttributeError: 'ARIMAResults' object has no attribute 'plot'
时间: 2023-11-13 19:04:59 浏览: 56
这个错误提示意味着你正在尝试使用一个名为'plot'的属性,但是该属性在'ARIMAResults'对象中不存在。这可能是因为你正在使用的版本与你的代码不兼容,或者你没有正确地导入所需的库或模块。为了解决这个问题,你可以尝试以下几个步骤:
1. 确认你正在使用的版本与你的代码兼容。你可以查看文档或者官方网站来获取更多信息。
2. 确认你已经正确地导入了所需的库或模块。你可以检查你的代码中是否存在任何拼写错误或语法错误。
3. 如果你确定你的代码和版本都是正确的,那么你可以尝试使用其他方法或属性来代替'plot'属性。你可以查看文档或者官方网站来获取更多信息。
相关问题
AttributeError: 'ARIMAResults' object has no attribute 'plot_predict
AttributeError: 'ARIMAResults' object has no attribute 'plot_predict'是由于ARIMA模型的版本问题导致的。在较新的版本中,plot_predict()方法已经被弃用,需要使用plot_forecast()方法代替。如果你想使用plot_predict()方法,可以将statsmodels的版本降至0.10.2以下。你可以通过以下代码解决这个问题:
```
import matplotlib.pyplot as plt
from statsmodels.tsa.arima_model import ARIMA
# 构建ARIMA模型
model = ARIMA(data, order=(p, d, q))
results_ARIMA = model.fit(disp=-1)
# 使用plot_forecast()方法绘制预测结果
results_ARIMA.plot_forecast(steps=10)
# 使用plot_predict()方法绘制预测结果
# results_ARIMA.plot_predict(start=1, end=100)
# plt.show()
```
AttributeError: DeltaPID object has no attribute fit_and_plot
这个错误提示说明 "DeltaPID" 对象没有 "fit_and_plot" 这个属性,可能是你的代码中出现了错误。
请检查以下几个可能的问题:
1. 是否正确导入了需要使用的库或模块?
2. 是否正确实例化了 "DeltaPID" 类?
3. 是否正确调用了 "fit_and_plot" 方法,即方法名是否拼写正确?
如果以上都没有问题,那就需要查看 "DeltaPID" 类的定义,确认该类是否定义了 "fit_and_plot" 方法。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)