Bladeren bron

feat:补数据

zhaohaipeng 6 maanden geleden
bovenliggende
commit
3b418b91c4
1 gewijzigde bestanden met toevoegingen van 9 en 3 verwijderingen
  1. 9 3
      ad/01_ad_model_update.sh

+ 9 - 3
ad/01_ad_model_update.sh

@@ -122,6 +122,7 @@ init() {
   echo "init param model_local_home: ${model_local_home}"
   echo "init param model_oss_path: ${MODEL_OSS_PATH}"
   echo "init param predict_analyse_file_path: ${predict_analyse_file_path}"
+  echo "init param current_day_of_week: ${current_day_of_week}"
 
   echo "当前Python环境安装的Python版本: $(python --version)"
   echo "当前Python环境安装的三方包: $(python -m pip list)"
@@ -327,11 +328,16 @@ main() {
 
   bucket_feature
 
-  xgb_train
+  if [ "${current_day_of_week}" -eq 2 ] || [ "${current_day_of_week}" -eq 5 ]; then
+    echo "当前是周二或周五,开始训练并更新模型"
+    xgb_train
 
-  model_predict
+    model_predict
 
-  model_upload_oss
+    model_upload_oss
+  else
+    echo "今天不是周二也不是周五,不更新模型"
+  fi 
 
 }