Parcourir la source

modify: 优化模型加载输出

yq il y a 1 mois
Parent
commit
79d49e412c
2 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 1 1
      entitys/ml_config_entity.py
  2. 2 2
      model/model_lr.py

+ 1 - 1
entitys/ml_config_entity.py

@@ -302,7 +302,7 @@ class MlConfigEntity():
                 j = json.loads(f.read())
         else:
             raise GeneralException(ResultCodesEnum.NOT_FOUND, message=f"指配置文件【{config_path}】不存在")
-
+        print(f"mlcfg load to【{config_path}】success. ")
         return MlConfigEntity(**j)
 
     def config_save(self):

+ 2 - 2
model/model_lr.py

@@ -91,14 +91,14 @@ class ModelLr(ModelBase):
 
         with open(path_model, 'rb') as f:
             self.lr = pickle.load(f)
+        print(f"model load from【{path_model}】success.")
 
         df_card = pd.read_csv(path_card)
         variables = df_card["variable"].unique().tolist()
         self.card = {}
         for variable in variables:
             self.card[variable] = df_card[df_card["variable"] == variable]
-
-        print(f"model load from【{path}】success.")
+        print(f"model load from【{path_card}】success.")
 
     def train_report(self, data: DataSplitEntity, *args, **kwargs) -> Dict[str, MetricFucResultEntity]: