[英]Why does auto_arima function from pmdarima package on python is much slower than auto.arima function available on R?
[英]pmdarima save auto.arima aic values
我在pmd arima (alkaline-ml/pmdarima) 的 GitHub 頁面中看到了這個問題。
答案來自積極維護 pmdarima 的Taylor G. Smith 。
有兩種方法。
1)
第一個是參數return_valid_fits設置為 True。 請參閱 pmdarima 1.8.0 文檔:
return_valid_fits :布爾值,可選(默認=假)
如果為 True,將返回所有有效的 ARIMA 適合列表。 如果為 False(默認),將只返回最佳擬合。
例子:
import pmdarima as pm
sxmodel = pm.auto_arima(endog[:n_train],exog[:n_train], start_p=0, start_q=0, max_p=2, max_q=2,
start_P=0,start_Q=0, max_P=2,max_D=1,max_Q=2, m=7, seasonal=True,
d=0, trace=True, error_action='trace',suppress_warnings=True, stepwise=True)
sxmodel
在第一種情況下,sxmodel 將是一個包含擬合模型信息的元組
2)
另一種是使用sys模塊:
import sys
orig_stdout = sys.stdout
f = open('out.txt', 'w')
sys.stdout = f
# fit your model
model = pm.auto_arima(...)
sys.stdout = orig_stdout
f.close()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.