瀏覽代碼

修复有效态Cd预测接口问题

drggboy 5 天之前
父節點
當前提交
8d2d1dee1f
共有 1 個文件被更改,包括 2 次插入10 次删除
  1. 2 10
      Cd_Prediction_Integrated_System/models/effective_cd_model/predict.py

+ 2 - 10
Cd_Prediction_Integrated_System/models/effective_cd_model/predict.py

@@ -163,9 +163,6 @@ class EffectiveCdPredictor:
             
             # 加载数据
             data = self.load_data()
-            # 保存原始数据,包括经纬度
-            longitude = data["longitude"].values
-            latitude = data["latitude"].values
             
             # 预处理数据
             X_tensor, special_feature_index = self.preprocess_data(data)
@@ -180,14 +177,9 @@ class EffectiveCdPredictor:
                 ).squeeze().numpy()
 
 
+            # 指数还原预测结果并按与作物Cd模型一致的格式输出为单列CSV
             cd_predictions = np.exp(predictions)
-
-            # 创建包含经纬度和预测结果的数据框
-            predictions_df = pd.DataFrame({
-                "longitude": longitude,
-                "latitude": latitude,
-                "cd_prediction": cd_predictions
-            })
+            predictions_df = pd.DataFrame(cd_predictions)
             output_path = os.path.join(
                 config.DATA_PATHS["predictions_dir"],
                 self.model_config["output_file"]