Open robomotic opened 4 years ago
Hi @robomotic, thanks for raising the issue! The reason they are different is that the book is based on the forecast
library in R, our class is based on statsmodels
exponential smoothing class.
One way to get the fitted parameters is to use get_fitted_params()
(the interface is still experimental):
from sktime.forecasting.all import *
y = load_airline()
forecaster = ExponentialSmoothing(trend=None, seasonal=None, optimized=True)
forecaster.fit(y)
forecaster.get_fitted_params()
There is also the AutoETS
class from from sktime.forecasting.ets import AutoETS
, but again based on statsmodels.
A PR would be appreciated if you want to write the examples you suggest!
I also ping @HYang1996 who wrote AutoETS
.
Perfect let me play with it and will post my findings here. I can then do a pull request if you like or you can just copy and paste my code.
Yes @robomotic that would be great! Thanks!
@mloning I have started with a Colab notebook: https://colab.research.google.com/drive/1UpGTb00pza1ss7iZ81VO_nj-xgyQTo_-?usp=sharing what I need now is the equivalent of getting the fitted values from the SK model, so I can plot the same graphs.
Thanks!
Hi @robomotic,
I had a look at the notebook and added two options to get the parameters:
forecaster._fitted_forecaster._results.params["smoothing_level"]
where the _fitted_forecaster
is the results wrapper from statsmodelsforecaster.get_fitted_params()["smoothing_level"]
which is sktime's unified interface to inspect fitted parameters (still experimental) and returns a dictionary with the fitted parameters, internally it just looks them up in the _fitted_forecaster
objectHope this helps!
Brilliant I completed the first example, I will do the other test cases now.
Describe the issue linked to the documentation
It is unclear from the documentation about how to use the constructor to achieve the different configurations for ExponentialSmoothing. With reference on page 204, section 7.4 of the book Forecasting: Principles and Practice (which is also mentioned in the source code) there are various combinations with Trend and Seasonal Component.
For example how can I achieve the (N,N) case with Simple exponential smoothing? I tried this:
I then want to see the level that would have been estimated
forecaster.smoothing_level
(which is referred as alpha in the book) but this is None. I also don't see a property in the code that would refer to what in the book is called lt (level different from alpha).Suggest a potential alternative/fix
Provide example code that matches the 6 potential configurations described in the book.