[英]FutureWarning: statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have been deprecated
While using ARMA to fit a model:在使用 ARMA 拟合 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?如何丢弃警告?
Instead of using而不是使用
from statsmodels.tsa.arima_model import ARIMA
Please change to following请改为以下
from statsmodels.tsa.arima.model import ARIMA
Run the code below to ignore ARIMA warnings运行以下代码以忽略 ARIMA 警告
import warnings
warnings.filterwarnings("ignore")
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
and statsmodels.tsa.SARIMAX
.截至今天,已删除
statsmodels.tsa.arima_model.ARMA
和statsmodels.tsa.arima_model.ARIMA
以支持statsmodels.tsa.arima.model.ARIMA
和statsmodels.tsa.SARIMAX
。 This is because statsmodels.tsa.arima.model.ARIMA
makes use of the statespace framework and is both well tested and maintained.这是因为
statsmodels.tsa.arima.model.ARIMA
使用了状态空间框架,并且经过了良好的测试和维护。 It also offers alternative specialized parameter estimators.它还提供了替代的专用参数估计器。
If you try to use ARMA
from statsmodels.tsa.arima_model
you'll get NotImplementedError
message error.如果您尝试使用
statsmodels.tsa.arima_model
中的ARMA
,您将收到NotImplementedError
消息错误。
A quick fix to use ARIMA
model could be like this:使用
ARIMA
model 的快速修复可能是这样的:
from statsmodels.tsa.arima.model import ARIMA
model = ARIMA(dataFrame.columnName, order=(1,0,0))
This warning is occuring due to deprication of the ARIMA package "statsmodels\tsa\arima_model".由于 ARIMA package“statsmodels\tsa\arima_model”的贬值,出现此警告。
Instead, import the statsmodel with:相反,使用以下命令导入 statsmodel:
import statsmodels.api as sm
And fit ARIMA model as:并将 ARIMA model 安装为:
model = sm.tsa.arima.ARIMA(train_data, order=(1,1,2))
result = model.fit()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.