Tempor-ai / sybil

SYBIL: The General-Purpose Forecaster
GNU General Public License v3.0
4 stars 0 forks source link

[bug] Cannot give custom preprocessor #70

Closed biranyucel closed 5 months ago

biranyucel commented 10 months ago

If we are giving custom preprocessors on model_request params, it doesn't work because base_models define on routes.py but preprocessor haven't.

example model_request params:

model_request = {
     'type': 'meta_lr',  # 'meta_wa'
     'scorers': ['smape', 'mape'],
     'params': {
         'preprocessors': [
             {'type': 'simpleimputer', 'params': {'strategy': 'mean'}},
             {'type': 'minmaxscaler'},
         ],
         'base_models': [
             # {'type': 'darts_rnn'},
             # {'type': 'darts_lightgbm'},  # TODO: Need to fix use of covariates lags
             {'type': 'darts_autotheta'},
             {'type': 'darts_autoarima'},
             {'type': 'darts_autoets'},
             # {'type': 'stats_autotheta'},
             # {'type': 'stats_autoarima'},
             # {'type': 'stats_autoets'},
         ],
     },
}

from the api_call_example_exovar.ipynb

biranyucel commented 10 months ago

I tried to define preprocessor under Parameters class basically like this but it gives error because it doesn't recognized but other Classes in the code

class Parameters(BaseModel):
    base_models: Union[List['Model'], None] = None
    preprocessors: Union[List['Model'], None] = None
Kevin-Chen0 commented 8 months ago

@guanth0520 can you take a look at this Issue? Thanks.