fitzgeraldja / stc_unicef_cpi

MIT License
0 stars 0 forks source link

change model save description #57

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 2 years ago

https://github.com/fitzgeraldja/stc_unicef_cpi/blob/cad6b9492e8ca15b940c1140f6d18b127f9ea6c8/src/stc_unicef_cpi/models/train_model.py#L693


                        )
            if args.save_model:
                if args.target != "all":
                    model_desc = f"{args.country}-{args.target}-{args.cv_type}-{args.universal_data_only}-{univ_data}-{ip_data}-{args.impute}-{args.standardise}-{args.target_transform}"
                    pipeline_desc = f"best_cfg-{model_desc}.pkl"
                    with open(
                        SAVE_DIRECTORY / f"{model_desc}.pkl",
                        "wb",
                    ) as f:
                        joblib.dump(pipeline, f)
                    with open(SAVE_DIRECTORY / pipeline_desc, "wb") as f:
                        pickle.dump(automl.best_config_per_estimator, f)
                else:
                    # TODO: change model save description
                    model_desc = f"{args.country}-{col}-{args.cv_type}-{args.universal_data_only}-{univ_data}-{ip_data}-{args.impute}-{args.standardise}-{args.target_transform}"
                    pipeline_desc = f"best_cfg-{model_desc}.pkl"
                    with open(SAVE_DIRECTORY / f"{model_desc}.pkl", "wb") as f:
                        joblib.dump(pipeline, f)

                    with open(SAVE_DIRECTORY / pipeline_desc, "wb") as f:
                        pickle.dump(automl.best_config_per_estimator, f)

    if args.log_run:
        mlflow.end_run()
        # Marina - two stage model as suggested by Lyudmila?
github-actions[bot] commented 2 years ago

Closed in 44fe64363b87ddff73edb8bfcea2330a7c353ca0