heidelbergcement/hcrystalball

[BUG] Handling of country_code_column in ModelSelector

MichalChromcak opened this issue · 0 comments

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.