Nixtla/hierarchicalforecast

[Core] not balancing when doing aggregate()

iamyihwa opened this issue · 3 comments

What happened + What you expected to happen

In the previous version of the hierarchicalforecast, during the aggregate() , forecasting became balanced.

Used more recent version of the code, and noticed that aggregated dataframe was not balanced.
This can be seen by when grouping by unique_id, number of values are not same for all of them, and also lots of forecasted results are NaN finally, when doing aggregate, then forecast (using statsforecast).

image

Versions / Dependencies

0.4.0

Reproduction script

Y_df, S_df, tags = aggregate(pd_df, spec)

Issue Severity

None

When using previous version (0.3.0) , for the same dataframe, I get all time series balanced.
However taking much longer to perform aggregate() then the most recent version.

image

Hey @iamyihwa, if your series have missing points I suggest you run the fill_gaps function first with start='global', end='global', fill the missing values with zero (which is what the previous version did) and then aggregate.

Yes ! @jmoralez ! It works fine with this method! Thanks for pointing me to it! It would perhaps be helpful to have this also in the documentation of the hierarchicalforecast and other libraries.