瀏覽代碼

feat:VOV模型

zhaohaipeng 9 月之前
父節點
當前提交
282ea0ea46
共有 2 個文件被更改,包括 8 次插入9 次删除
  1. 1 0
      .gitignore
  2. 7 9
      XGB/vov_xgboost_train.py

+ 1 - 0
.gitignore

@@ -62,4 +62,5 @@ target/
 
 XGB/new*
 XGB/data
+XGB/file
 logs

+ 7 - 9
XGB/vov_xgboost_train.py

@@ -35,11 +35,9 @@ def get_partition_df(table, dt):
     try:
         download_session = odps_client.get_download_session(table, dt)
         logger.info(f"表: {table} 中的分区 {dt}, 共有 {download_session.count} 条数据")
-        with download_session.open_record_reader(0, download_session.count) as reader:
-            records = []
-            for record in reader:
-                records.append(record.values)  # 获取每一行的值
-            df = pd.DataFrame(records, columns=[col.name for col in reader.schema.columns])  # 转换为 DataFrame
+        with download_session.open_arrow_reader(0, download_session.count) as reader:
+            # 将所有数据加载到 DataFrame 中
+            df = pd.concat([batch.to_pandas() for batch in reader])
     except Exception as e:
         logger.error(f"下载 {table} -- {dt} 的数据异常: ", e)
 
@@ -387,7 +385,7 @@ if __name__ == '__main__':
         card_json['i18n_header']['zh_cn']["title"]['content'] = "XGB模型训练预测失败"
         card_json['i18n_elements']['zh_cn'][0]['content'] = msg_text
         # 发送通知
-    feishu_inform_util.send_card_msg_to_feishu(
-        webhook=config_manager.get_vov_model_inform_feishu_webhook(),
-        card_json=card_json
-    )
+    # feishu_inform_util.send_card_msg_to_feishu(
+    #     webhook=config_manager.get_vov_model_inform_feishu_webhook(),
+    #     card_json=card_json
+    # )