heidelbergcement / hcrystalball

A library that unifies the API for most commonly used libraries and modeling techniques for time-series forecasting in the Python ecosystem.
https://hcrystalball.readthedocs.io/
MIT License
152 stars 19 forks source link

[BUG] Handling of country_code_column in ModelSelector #31

Closed MichalChromcak closed 4 years ago

MichalChromcak commented 4 years ago

Describe the bug When calling init on ModelSelector, country_code_column can be optionally supplied. This value is not used in ModelSelector.select_model, neither in ModelSelector.create_gridsearch.

To Reproduce

>>> from hcrystalball.model_selection import ModelSelector

>>> ms = ModelSelector(frequency='D', horizon=10, country_code_column="region")
>>> ms.create_gridsearch()
>>> ms.grid_search.estimator.steps
[('exog_passthrough', 'passthrough'),
 ('holiday', 'passthrough'),
 ('model', 'passthrough')]

Here ('holiday') step should have HolidayTransformer, not 'passthrough'.

Expected behavior 1 ModelSelector instance per country_code_column value -> country_code_column to be only supplied at init time and later used in further methods (same as e.g. frequency)

Additional context Add any other context about the problem here.