hierarchicalforecast icon indicating copy to clipboard operation
hierarchicalforecast copied to clipboard

Example not working

Open Forecastlife opened this issue 2 years ago • 1 comments

Trying to implement on forecasts that i already have (both aggregations and low level)

I made my own summing matrix but when running the tutorial to see what the y_hat_df was formatted like, ran into this error:

""" TypeError Traceback (most recent call last) in () 2 models=[(ets, 4, 'ZZA')], 3 freq='QS', n_jobs=-1) ----> 4 Y_hat_df = fcst.forecast(h=8, fitted=True) 5 Y_fitted_df = fcst.forecast_fitted_values()

3 frames /usr/lib/python3.7/multiprocessing/pool.py in get(self, timeout) 655 return self._value 656 else: --> 657 raise self._value 658 659 def _set(self, i, obj):

TypeError: seasonal_decompose() got an unexpected keyword argument 'period'

"""

Which is odd bc I use seasonal decompose and know it has a period argument..

This happens on all tutorials or examples when opening in collab..

Do you have an example of implementation with forecasts/tags you already have or could you please fix the examples?

Forecastlife avatar Aug 02 '22 13:08 Forecastlife

Hi @Forecastlife! Thank you very much for letting us know about the issue.

The problem arises from the statsmodels version and is related to StatsForecast. By default, colab has the 0.10.2 version of statsmodels which does not include the period argument.

To solve the issue, you can run pip install -U statsmodels at the beginning of the notebook to update statsmodels to the most recent version.

We have updated the examples to include the line. (#35)

Regarding the format of Y_hat_df, it's a pandas dataframe indexed by each time series, includes a ds column containing the forecast horizon and a column for each model.

image

Please let us know if the problem persists.

AzulGarza avatar Aug 02 '22 17:08 AzulGarza