FutureWarning: statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have been deprecated
Asked Answered
O

4

10

While using ARMA to fit a model:

from statsmodels.tsa.arima_model import ARMA

I am getting a warning in my console:

C:\Users\lfc\anaconda3\lib\site-packages\statsmodels\tsa\arima_model.py:472: FutureWarning: 
statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have been deprecated in favor of statsmodels.tsa.arima.model.ARIMA (note the . between arima and model) and statsmodels.tsa.SARIMAX. These will be removed after the 0.12 release.

statsmodels.tsa.arima.model.ARIMA makes use of the statespace framework and
is both well tested and maintained.

To silence this warning and continue using ARMA and ARIMA until they are
removed, use:

import warnings
warnings.filterwarnings('ignore', 'statsmodels.tsa.arima_model.ARMA',
                        FutureWarning)
warnings.filterwarnings('ignore', 'statsmodels.tsa.arima_model.ARIMA',
                        FutureWarning)

warnings.warn(ARIMA_DEPRECATION_WARN, FutureWarning)

How do I discard the warning?

Orenorenburg answered 19/5, 2021 at 10:9 Comment(1)
You can run the code that is in the warning exactly if you want to silence them. These have been removed from the future v0.13 release. You should instead use statsmodels.tsa.arima.model.ARIMA which is the future version.Hawkbill
D
12

This warning is occuring due to deprication of the ARIMA package "statsmodels\tsa\arima_model".

Instead, import the statsmodel with:

import statsmodels.api as sm

And fit ARIMA model as:

model = sm.tsa.arima.ARIMA(train_data, order=(1,1,2))
result = model.fit()
Drift answered 25/12, 2021 at 9:30 Comment(0)
B
11

As of today, the statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have been removed in favor of statsmodels.tsa.arima.model.ARIMA (without _) and statsmodels.tsa.SARIMAX.

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

If you try to use ARMA from statsmodels.tsa.arima_model you'll get NotImplementedError message error.

A quick fix to use ARIMA model could be like this:

from statsmodels.tsa.arima.model import ARIMA
model = ARIMA(dataFrame.columnName, order=(1,0,0))

You can find more details in this issue.

Big answered 15/11, 2021 at 17:38 Comment(2)
sm.tsa.arima.ARIMA plot_predict is not defined. what should I useGates
@GoldenLion for ARIMA model you can use your_model.predict(start = start_date, end = end_date) then plot() the predictions and use plot_forecast(value) for the forecast.Big
O
4

Instead of using

from statsmodels.tsa.arima_model import ARIMA

Please change to following

from statsmodels.tsa.arima.model import ARIMA
Overcrop answered 6/6, 2022 at 22:42 Comment(0)
O
2

Run the code below to ignore ARIMA warnings

import warnings

warnings.filterwarnings("ignore")

Orenorenburg answered 27/5, 2021 at 5:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.