|
@@ -84,42 +84,42 @@ export JAVA_HOME=/usr/lib/jvm/java-1.8.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-$HADOOP fs -text ${bucketFeatureSavePath}/${today_early_1}/* | ${FM_HOME}/bin/fm_train -m ${MODEL_PATH}/${model_name}_${today_early_1}.txt -dim 1,1,8 -im ${LAST_MODEL_HOME}/model_online.txt -core 8
|
|
+
|
|
-if [ $? -ne 0 ]; then
|
|
+
|
|
- echo "模型训练失败"
|
|
+
|
|
- /root/anaconda3/bin/python ad/ad_monitor_util.py "广告模型训练失败"
|
|
+
|
|
- exit 1
|
|
+
|
|
-fi
|
|
+
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-$HADOOP fs -text ${bucketFeatureSavePath}/${today}/* | ${FM_HOME}/bin/fm_predict -m ${LAST_MODEL_HOME}/model_online.txt -dim 8 -core 8 -out ${PREDICT_PATH}/${model_name}_${today}_online.txt
|
|
|
|
-$HADOOP fs -text ${bucketFeatureSavePath}/${today}/* | ${FM_HOME}/bin/fm_predict -m ${MODEL_PATH}/${model_name}_${today_early_1}.txt -dim 8 -core 8 -out ${PREDICT_PATH}/${model_name}_${today}_new.txt
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-online_auc=`cat ${PREDICT_PATH}/${model_name}_${today}_online.txt | /root/sunmingze/AUC/AUC`
|
|
|
|
-if [ $? -ne 0 ]; then
|
|
|
|
- echo "线上模型AUC计算失败"
|
|
|
|
- /root/anaconda3/bin/python ad/ad_monitor_util.py "线上模型AUC计算失败"
|
|
|
|
- exit 1
|
|
|
|
-fi
|
|
|
|
|
|
|
|
-new_auc=`cat ${PREDICT_PATH}/${model_name}_${today}_new.txt | /root/sunmingze/AUC/AUC`
|
|
|
|
-if [ $? -ne 0 ]; then
|
|
|
|
- echo "新模型AUC计算失败"
|
|
|
|
- /root/anaconda3/bin/python ad/ad_monitor_util.py "新模型AUC计算失败"
|
|
|
|
- exit 1
|
|
|
|
-fi
|
|
|
|
|
|
|
|
-if [ "$online_auc" \< "$new_auc" ]; then
|
|
+
|
|
- echo "新模型优于线上模型: 线上模型AUC: ${online_auc}, 新模型AUC: ${new_auc}"
|
|
+
|
|
- /root/anaconda3/bin/python ad/ad_monitor_util.py "新模型优于线上模型: 线上模型AUC: ${online_auc}, 新模型AUC: ${new_auc}"
|
|
+
|
|
-else
|
|
+
|
|
- echo "新模型不如线上模型: 线上模型AUC: ${online_auc}, 新模型AUC: ${new_auc}"
|
|
+
|
|
- /root/anaconda3/bin/python ad/ad_monitor_util.py "新模型不如线上模型: 线上模型AUC: ${online_auc}, 新模型AUC: ${new_auc}"
|
|
+
|
|
- exit 1
|
|
+
|
|
-fi
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -163,12 +163,12 @@ awk -F " " '{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-cp -f ${LAST_MODEL_HOME}/model_online.txt ${LAST_MODEL_HOME}/model_online_$(date +\%Y\%m\%d).txt
|
|
+
|
|
-cp -f ${MODEL_PATH}/${model_name}_${today_early_1}.txt ${LAST_MODEL_HOME}/model_online.txt
|
|
+
|
|
-if [ $? -ne 0 ]; then
|
|
+
|
|
- echo "模型备份失败"
|
|
+
|
|
- /root/anaconda3/bin/python ad/ad_monitor_util.py "模型备份失败 - 最新模型地址: ${MODEL_PATH}/${model_name}_${today_early_1}.txt"
|
|
+
|
|
- exit 1
|
|
+
|
|
-fi
|
|
+
|
|
|
|
|
|
|
|
|