Tempor-ai / sybil

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

[feature] Convert the model_request as a .json, .yaml, and/or .config file and pass it into example notebooks #91

Closed Kevin-Chen0 closed 7 months ago

Kevin-Chen0 commented 8 months ago

For example, instead of this JSON request:

# Customized model request
model_request = {
    'type': 'meta_lr',  # 'meta_wa'
    'scorers': ['smape', 'mape'],
    'params': {
        'preprocessors': [
            {'type': 'dartsimputer', 'params': {'strategy': 'mean'}},
            # {'type': 'simpleimputer', 'params': {'strategy': 'mean'}},
            {'type': 'minmaxscaler'},
        ],
        'base_models': [
            {'type': 'darts_naive'},
            {'type': 'darts_seasonalnaive'},
            {'type': 'darts_autotheta'},
            # {'type': 'stats_autotheta'},
            {'type': 'darts_autoets'},
            # {'type': 'stats_autoets'},
            {'type': 'darts_autoarima'},
            # {'type': 'stats_autoarima'},
            {'type': 'darts_tbats'},
            {'type': 'darts_linearregression'},
            # {'type': 'darts_lightgbm'},
            # {'type': 'darts_rnn'},
        ],
    },
}

The example notebooks can load the following attached model_request.json or model_request.yaml. The notebooks when convert this files into the JSON string model_request, which will be passed into the api_json, alongside the uploaded train dataset:

api_json = {
    'data': train_data,
    'model': model_request  # (optional) can be commented out
}
Kevin-Chen0 commented 8 months ago

model_request.json

model_request.yaml below:

type: meta_lr
scorers: [smape, mape]
params:
  preprocessors:
    type: dartsimputer
      params:
        strategy: mean
    type: minmaxscaler
  base_models:
    type: darts_naive
    type: darts_seasonalnaive
    type: darts_autotheta
    type: darts_autoets
    type: darts_autoarima
    type: darts_tbats
    type: darts_linearregression
Kevin-Chen0 commented 7 months ago

Resolved.