Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make best fitted ARIMA an output of AutoARIMA #774

Open
RickoClausen opened this issue Feb 2, 2024 · 2 comments
Open

Make best fitted ARIMA an output of AutoARIMA #774

RickoClausen opened this issue Feb 2, 2024 · 2 comments

Comments

@RickoClausen
Copy link

RickoClausen commented Feb 2, 2024

Description

I would greatly appreciate being able to access the best-fitted ARIMA model from AutoARIMA.

It is a common use case to optimize the model hyperparameters on one period and then fit and predict an ARIMA model with those hyperparameters on a different period.

@jmoralez
Copy link
Member

Hey @RickoClausen, thanks for using statsforecast. If you use fit then the trained models are stored in the fitted_ attribute. The p, d, q, P, D, Q, m parameters can be retrieved with the following:

sf = StatsForecast(...)
sf.fit(...)
params = [
    [m.model_["arma"][i] for i in [0, 5, 1, 2, 6, 3, 4]]
    for m in sf.fitted_[:, 0]  # assuming AutoARIMA is the first model in the list
] 

This will create a list where each element is a list with the optimal parameters for that serie.

@RickoClausen
Copy link
Author

Thanks. :)
However I still think it would make sense to have a property of the Auto classes, which can return the best-fitted non-auto version of the model, entire model class instance, instead of just the parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants