|
@@ -79,7 +79,7 @@ class ModelLr(ModelBase):
|
|
|
GeneralException(ResultCodesEnum.NOT_FOUND, message=f"模型不存在")
|
|
|
if self.card is None:
|
|
|
GeneralException(ResultCodesEnum.NOT_FOUND, message=f"card不存在")
|
|
|
- path = self.ml_config.f_get_save_path(FileEnum.MODEL.value)
|
|
|
+ path = self.ml_config.f_get_save_path(FileEnum.PIPELINE_XGB.value)
|
|
|
self.lr.save(path)
|
|
|
print(f"model save to【{path}】success. ")
|
|
|
|
|
@@ -90,7 +90,7 @@ class ModelLr(ModelBase):
|
|
|
print(f"model save to【{path}】success. ")
|
|
|
|
|
|
df_card = pd.concat(self.card.values())
|
|
|
- path = self.ml_config.f_get_save_path(FileEnum.CARD.value)
|
|
|
+ path = self.ml_config.f_get_save_path(FileEnum.CARD_CSV.value)
|
|
|
df_card.to_csv(path)
|
|
|
print(f"model save to【{path}】success. ")
|
|
|
|
|
@@ -103,21 +103,21 @@ class ModelLr(ModelBase):
|
|
|
woebin = context.get(ContextEnum.WOEBIN)
|
|
|
df_woebin = pd.concat(woebin.values())
|
|
|
df_var_mapping = f_get_var_mapping(df_woebin, df_card, columns_anns=self.ml_config.columns_anns)
|
|
|
- path = self.ml_config.f_get_save_path(FileEnum.VAR_MAPPING.value)
|
|
|
+ path = self.ml_config.f_get_save_path(FileEnum.VAR_MAPPING_CSV.value)
|
|
|
df_var_mapping.to_csv(path, encoding="utf-8")
|
|
|
print(f"model save to【{path}】success. ")
|
|
|
|
|
|
- path = self.ml_config.f_get_save_path(FileEnum.TEST_CASE.value)
|
|
|
+ path = self.ml_config.f_get_save_path(FileEnum.TEST_CASE_CSV.value)
|
|
|
self._test_case.to_csv(path, encoding="utf-8")
|
|
|
print(f"test case save to【{path}】success. ")
|
|
|
|
|
|
def model_load(self, path: str, *args, **kwargs):
|
|
|
if not os.path.isdir(path):
|
|
|
raise GeneralException(ResultCodesEnum.NOT_FOUND, message=f"【{path}】不是文件夹")
|
|
|
- path_model = os.path.join(path, FileEnum.MODEL.value)
|
|
|
+ path_model = os.path.join(path, FileEnum.PIPELINE_XGB.value)
|
|
|
if not os.path.isfile(path_model):
|
|
|
raise GeneralException(ResultCodesEnum.NOT_FOUND, message=f"模型文件【{path_model}】不存在")
|
|
|
- path_card = os.path.join(path, FileEnum.CARD.value)
|
|
|
+ path_card = os.path.join(path, FileEnum.CARD_CSV.value)
|
|
|
if not os.path.isfile(path_card):
|
|
|
raise GeneralException(ResultCodesEnum.NOT_FOUND, message=f"模型文件【{path_card}】不存在")
|
|
|
|