diff --git a/.gitignore b/.gitignore index b7de2598..e0f05476 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,5 @@ package.json *.csv evaluation_results -*.pqt \ No newline at end of file +*.pqt +tests/test_eval_results diff --git a/src/psycop_model_training/training_output/artifact_saver/to_disk.py b/src/psycop_model_training/training_output/artifact_saver/to_disk.py index c99960bd..eab2a2b7 100644 --- a/src/psycop_model_training/training_output/artifact_saver/to_disk.py +++ b/src/psycop_model_training/training_output/artifact_saver/to_disk.py @@ -1,3 +1,4 @@ +import json import logging from pathlib import Path from typing import Any, Optional, Union @@ -82,6 +83,10 @@ def save( if cfg is not None: dump_to_pickle(cfg, self.dir_path / "cfg.pkl") + with (self.dir_path / "cfg.json").open(mode="w") as f: + cfg_dict = cfg.json() + json.dump(cfg_dict, f) + if pipe_metadata is not None: dump_to_pickle(pipe_metadata, self.dir_path / "pipe_metadata.pkl")