best_config = config_init.copy()
for i, param_name in enumerate(best_params_dict.keys()):
if param_name != target_metric:
best_config = params_helper.insert_value_or_dict_into_config(best_config, param_paths[i],
best_params_dict[param_name])
best_model_filename = pipeline_config_path.with_name(pipeline_config_path.name.replace(".json", "_cvbest.json"))
save_json(best_config, best_model_filename)
log.info("Best model saved in json-file: {}".format(best_model_filename))
After Change
best_config = config_init
for i, param_name in enumerate(best_params_dict.keys()):
if param_name != target_metric:
params_helper.insert_value_or_dict_into_config(best_config, param_paths[i], best_params_dict[param_name])
best_model_filename = pipeline_config_path.with_suffix(".cvbest.json")
save_json(best_config, best_model_filename)
log.info("Best model saved in json-file: {}".format(best_model_filename))