alkaline-ml / pmdarima

A statistical library designed to fill the void in Python's time series analysis capabilities, including the equivalent of R's auto.arima function.
https://www.alkaline-ml.com/pmdarima
MIT License
1.58k stars 234 forks source link

Return fitted values during training phase #493

Closed TiaHao closed 2 years ago

TiaHao commented 2 years ago

Is your feature request related to a problem? Please describe.

Hi,

This library is quite powerful and I appreciate it a lot. I am wondering is there any way to return back the fitted values for training phase, like the fittedvalues attribute of sarima model in statsmodels package? I would like to compute the R2, RMSE, etc for training phase as well.

Thank you!

Describe the solution you'd like

one added attribute for the train function

Describe alternatives you've considered

directly return back some evaluation metrics: R2, RMSE, MSE, MAPE etc. for training phase

Additional Context

No response

tgsmith61591 commented 2 years ago

This can currently be accessed via the private arima_res_ attribute. But this would be a pretty easy attribute to expose at the top-level. We'll get this into the next release

import pmdarima as pm

y = pm.datasets.load_wineind()
mod = pm.ARIMA((1, 0, 2)).fit(y)
mod.arima_res_.fittedvalues
tgsmith61591 commented 2 years ago

Merged into master, and will be released in the next version