要从 AutoARIMA 模型摘要中获取 order 和seasonal_order 值,我们可以使用 get_params()。
https://scikit-learn.org/stable/modules/generated/sklearn.base.BaseEstimator.html
点击下面的链接以获得更好的图片。
This is the model summary of AUTOARIMA\
model = auto_arima(df_weekly1['Value'], start_p = 1, start_q = 1,
max_p = 3, max_q = 3, m = 12,
start_P = 0, seasonal = True,
d = None, D = 1, trace = True)
model.summary()
We can get the model summary values using get_params(), the output of the get_params function will be a dict datatype.
get_parametes = model.get_params()
print(type(get_parametes))
get_parametes
Get the required values using Key-Value pair and assign the same to a variable.
order_aa = get_parametes.get('order')
seasonal_order_aa = get_parametes.get('seasonal_order')
print('order:', order_aa)
print('seasonal_order:', seasonal_order_aa)
print('order DTYPE:', type(order_aa))
print('seasonal_order DTYPE:', type(seasonal_order_aa))
model_ss = SARIMAX(train['Col_Name'],
order = (order_aa[0], order_aa[1], order_aa[2]),
seasonal_order =(seasonal_order_aa[0],
seasonal_order_aa[1], seasonal_order_aa[2], seasonal_order_aa[3]))
result_ss = model_ss.fit()
result_ss.summary()