【问题标题】:Getting NotImplementedError while training ARIMA model训练 ARIMA 模型时出现 NotImplementedError
【发布时间】:2022-10-22 23:26:56
【问题描述】:

我正在尝试在时间序列数据集上使用 ARIMA 算法。一切都很好,直到我初始化模型。

初始化 ARIMA 模型后,我收到错误消息:

    28 def __init__(self, *args, **kwargs):
    ---> 29     raise NotImplementedError(ARIMA_DEPRECATION_ERROR)

    NotImplementedError: 
    statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have
    been removed in favor of statsmodels.tsa.arima.model.ARIMA (note the .
    between arima and model) and statsmodels.tsa.SARIMAX.

    statsmodels.tsa.arima.model.ARIMA makes use of the statespace framework and
    is both well tested and maintained. It also offers alternative specialized
    parameter estimators.

请帮我弄清楚。

【问题讨论】:

    标签: time-series arima


    【解决方案1】:

    您正在初始化已弃用的 ARIMA 模型。 statsmodels.tsa.arima_model.ARIMA 类在新版本的 statsmodels 中不再可用。在您的代码中的某处,您可以使用以下内容导入模型:

    from statsmodels.tsa.arima_model import ARIMA

    只需将其替换为较新的型号:

    from statsmodels.tsa.arima.model import ARIMA

    然后它应该再次工作。也许您必须更改一些参数,请查看文档: https://www.statsmodels.org/devel/generated/statsmodels.tsa.arima.model.ARIMA.html

    【讨论】:

      猜你喜欢
      • 2021-05-18
      • 1970-01-01
      • 2021-02-08
      • 1970-01-01
      • 2019-08-02
      • 1970-01-01
      • 2017-08-19
      • 1970-01-01
      • 2022-01-12
      相关资源
      最近更新 更多