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

TopDown Approach doesn't raise Exception as expected with method="forecast_proportions" #221

Open
baniasbaabe opened this issue Jul 10, 2023 · 0 comments
Labels

Comments

@baniasbaabe
Copy link

What happened + What you expected to happen

Calling

hrec = HierarchicalReconciliation(reconcilers=[TopDown(method="forecast_proportions")])

surprisingly works, since in hierarchicalforecast/hierarchicalforecast/methods.py, the following lines in the TopDown class appears

elif self.method == 'forecast_proportions':
      raise Exception(f'Fit method not implemented for {self.method} yet')

So forecast_proportions shouldn't work, right?

Versions / Dependencies

0.3.0

Reproduction script

It's the snippet from the README of this project:

# !pip install -U numba statsforecast datasetsforecast
import pandas as pd

# compute base forecast no coherent
from statsforecast.core import StatsForecast
from statsforecast.models import AutoARIMA, Naive

#obtain hierarchical reconciliation methods and evaluation
from hierarchicalforecast.core import HierarchicalReconciliation
from hierarchicalforecast.methods import BottomUp, TopDown, MiddleOut

#obtain hierarchical datasets
from datasetsforecast.hierarchical import HierarchicalData

# Load TourismSmall dataset
Y_df, S, tags = HierarchicalData.load('./data', 'TourismSmall')
Y_df['ds'] = pd.to_datetime(Y_df['ds'])


# Compute base level predictions 
sf = StatsForecast(df=Y_df, 
                   models=[AutoARIMA(season_length=12), Naive()], 
                   freq='M', n_jobs=-1)

forecasts_df = sf.forecast(h=12)

# Reconcile the base predictions
reconcilers = [
    TopDown(method='forecast_proportions'),
]

hrec = HierarchicalReconciliation(reconcilers=reconcilers)

reconciled_forecasts = hrec.reconcile(Y_hat_df=forecasts_df, S=S, tags=tags)

Issue Severity

Low: It annoys or frustrates me.

@baniasbaabe baniasbaabe changed the title TopDown Approach doesn't raise Exception as expected with method="forecast_proportions" TopDown Approach doesn't raise Exception as expected with method="forecast_proportions" Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant