Skip to content

Instantly share code, notes, and snippets.

@elisim
Last active September 2, 2021 09:35
Show Gist options
  • Save elisim/010234cbb2a34d8e1c44bb300c7a5a22 to your computer and use it in GitHub Desktop.
Save elisim/010234cbb2a34d8e1c44bb300c7a5a22 to your computer and use it in GitHub Desktop.
Hydra-Sklearn Blog - Code example 6
import hydra
from omegaconf import DictConfig
@hydra.main(config_path="configs/", config_name="config.yaml")
def main(config: DictConfig):
# instantiate our preprocessing pipeline to
# sklearn Pipeline object using hydra configuration
preprocessing_pipeline = hydra.utils.instantiate(
config.preprocessing_pipeline, _recursive_=False
)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment