facebookresearch / hydra

Hydra is a framework for elegantly configuring complex applications
https://hydra.cc
MIT License
8.84k stars 638 forks source link

How to override the default model in main.yaml in code when testing different models #2938

Open ETTAN93 opened 3 months ago

ETTAN93 commented 3 months ago

This is the current file structure that I have where the root config level has a main.yaml file and a models folder that consists of the different model definitions. image image

In my main.yaml file, I defined the default model as LGBM: image image

Hence, when I run config.models, I get image

Let's say for example now I want to switch to testing a naive_seasonal model instead where it is defined as: image

How do I do that with hydra in code? I know that I can override parameters in the main.yaml file, for example config.data.start_date = '2017-01-01'and that would override the original value. How do I do the same with the model so that it points to the right hyperparameters? I tried config.model_type = 'naive_s'but that only changes the model type and not the model hyperparameters.