liqian 1 year ago
parent
commit
3735c76561
3 changed files with 93 additions and 32 deletions
  1. 48 32
      ad_model_run.sh
  2. 28 0
      ad_predict_data_process_task.sh
  3. 17 0
      ad_xgboost_threshold_update_task.sh

+ 48 - 32
ad_model_run.sh

@@ -6,6 +6,7 @@ now_date=`date +"%Y%m%d"`
 echo "now_date: $now_date"
 
 # 1. 下载训练所用特征数据并做处理
+echo "ad_feature_process start..."
 python ad_feature_process.py
 if [ $? -ne 0 ];
 then
@@ -13,8 +14,10 @@ then
   echo $msg
   exit -1
 fi
+echo "ad_feature_process end!"
 
 # 2. 对样本进行采样
+echo "ad_feature_data_sample start..."
 python ad_feature_data_sample.py
 if [ $? -ne 0 ];
 then
@@ -22,8 +25,10 @@ then
   echo $msg
   exit -1
 fi
+echo "ad_feature_data_sample end!"
 
 # 3. 训练集和测试集生成
+echo "ad_generate_train_test start..."
 python ad_generate_train_test.py
 if [ $? -ne 0 ];
 then
@@ -31,8 +36,10 @@ then
   echo $msg
   exit -1
 fi
+echo "ad_generate_train_test end!"
 
 # 4. 模型训练
+echo "ad_xgboost_train start..."
 python ad_xgboost_train.py
 if [ $? -ne 0 ];
 then
@@ -40,37 +47,46 @@ then
   echo $msg
   exit -1
 fi
+echo "ad_xgboost_train end!"
 
-# 5. 离线预测数据处理
-python ad_predict_video_data_process.py
-if [ $? -ne 0 ];
-then
-  msg = "[ERROR] ad_predict_video_data_process.py"
-  echo $msg
-  exit -1
-fi
-
-python ad_predict_user_data_process.py
-if [ $? -ne 0 ];
-then
-  msg = "[ERROR] ad_predict_user_data_process.py"
-  echo $msg
-  exit -1
-fi
+## 5. 离线预测数据处理
+#echo "ad_predict_video_data_process start..."
+#python ad_predict_video_data_process.py
+#if [ $? -ne 0 ];
+#then
+#  msg = "[ERROR] ad_predict_video_data_process.py"
+#  echo $msg
+#  exit -1
+#fi
+#echo "ad_predict_video_data_process end!"
+#
+#echo "ad_predict_user_data_process start..."
+#python ad_predict_user_data_process.py
+#if [ $? -ne 0 ];
+#then
+#  msg = "[ERROR] ad_predict_user_data_process.py"
+#  echo $msg
+#  exit -1
+#fi
+#echo "ad_predict_user_data_process end!"
+#
+#echo "ad_xgboost_predict_data_generate start..."
+#python ad_xgboost_predict_data_generate.py
+#if [ $? -ne 0 ];
+#then
+#  msg = "[ERROR] ad_xgboost_predict_data_generate.py"
+#  echo $msg
+#  exit -1
+#fi
+#echo "ad_xgboost_predict_data_generate end!"
 
-python ad_xgboost_predict_data_generate.py
-if [ $? -ne 0 ];
-then
-  msg = "[ERROR] ad_xgboost_predict_data_generate.py"
-  echo $msg
-  exit -1
-fi
-
-# 6. 离线预测
-python ad_xgboost_predict.py
-if [ $? -ne 0 ];
-then
-  msg = "[ERROR] ad_xgboost_predict.py"
-  echo $msg
-  exit -1
-fi
+## 6. 离线预测
+#echo "ad_xgboost_predict start..."
+#python ad_xgboost_predict.py
+#if [ $? -ne 0 ];
+#then
+#  msg = "[ERROR] ad_xgboost_predict.py"
+#  echo $msg
+#  exit -1
+#fi
+#echo "ad_xgboost_predict end!"

+ 28 - 0
ad_predict_data_process_task.sh

@@ -0,0 +1,28 @@
+#!/bin/bash
+source ~/.bash_profile
+conda activate rov-offline-py38
+cd /data/rov-offline
+now_date=`date +"%Y%m%d"`
+echo "now_date: $now_date"
+
+# 视频数据处理
+echo "ad_predict_video_data_process start..."
+python ad_predict_video_data_process.py
+if [ $? -ne 0 ];
+then
+  msg = "[ERROR] ad_predict_video_data_process.py"
+  echo $msg
+  exit -1
+fi
+echo "ad_predict_video_data_process end!"
+
+# 用户数据处理
+echo "ad_predict_user_data_process start..."
+python ad_predict_user_data_process.py
+if [ $? -ne 0 ];
+then
+  msg = "[ERROR] ad_predict_user_data_process.py"
+  echo $msg
+  exit -1
+fi
+echo "ad_predict_user_data_process end!"

+ 17 - 0
ad_xgboost_threshold_update_task.sh

@@ -0,0 +1,17 @@
+#!/bin/bash
+source ~/.bash_profile
+conda activate rov-offline-py38
+cd /data/rov-offline
+now_date=`date +"%Y%m%d"`
+echo "now_date: $now_date"
+
+# 阈值计算
+echo "ad_xgboost_threshold_update start..."
+python ad_xgboost_threshold_update.py
+if [ $? -ne 0 ];
+then
+  msg = "[ERROR] ad_xgboost_threshold_update.py"
+  echo $msg
+  exit -1
+fi
+echo "ad_xgboost_threshold_update end!"