Sfoglia il codice sorgente

feat:添加测试脚本

zhaohaipeng 6 mesi fa
parent
commit
46b7c9faf2
1 ha cambiato i file con 10 aggiunte e 11 eliminazioni
  1. 10 11
      ad/00_test.sh

+ 10 - 11
ad/00_test.sh

@@ -5,9 +5,12 @@ set -x
 source /root/anaconda3/bin/activate py37
 
 # 模型保存路径
-model_save_path=""
+model_save_path=/dw/recommend/model/35_ad_model/model_xgb_351_1000_v2_1009_1015
 MODEL_OSS_PATH=oss://art-recommend.oss-cn-hangzhou.aliyuncs.com/zhangbo/
 model_name=model_xgb_351_1000_v2
+predict_analyse_file_path=/root/zhaohp/XGB/predict_analyse_file/20241014_351_1000_analyse.txt
+
+start_time=$(date +%s)
 
 # 保存模型评估的分析结果
 old_incr_rate_avg=0
@@ -15,10 +18,10 @@ new_incr_rate_avg=0
 declare -A old_score_map
 declare -A new_score_map
 
-local count=0
-local max_line=10
-local old_total_diff=0
-local new_total_diff=0
+count=0
+max_line=10
+old_total_diff=0
+new_total_diff=0
 while read -r line && [ ${count} -lt ${max_line} ]; do
 
     # 使用 ! 取反判断,只有当行中不包含 "cid" 时才执行继续的逻辑
@@ -55,17 +58,13 @@ msg+="\n\t - 新模型Top10差异平均值: ${new_incr_rate_avg}"
 msg+="\n\t - 模型在HDFS中的路径: ${model_save_path}"
 msg+="\n\t - 模型上传路径: ${MODEL_OSS_PATH}/${model_name}.tar.gz"
 
-local top10_msg = "| CID  | 老模型    | 新模型    | \n| ---- | -------- | -------- | "
-for cid in "${!new_score_map[@]}"; do
-top10_msg="${top10_msg} \n| ${cid} | ${old_score_map[$cid]} | ${new_score_map[$cid]} | "
-done
 
-local top10_msg = "| CID  | 老模型    | 新模型    | \n| ---- | -------- | -------- | "
+top10_msg = "| CID  | 老模型    | 新模型    | \n| ---- | -------- | -------- | "
 for cid in "${!new_score_map[@]}"; do
     top10_msg="${top10_msg} \n| ${cid} | ${old_score_map[$cid]} | ${new_score_map[$cid]} | "
 done
 
 
-/root/anaconda3/bin/python ${sh_path}/ad_monitor_util.py --level info --msg "${msg}" --start "${start_time}" --elapsed "${elapsed}" --top10 "${top10_msg}"
+/root/anaconda3/bin/python ${sh_path}/ad_monitor_util.py --level info --msg "${msg}" --start "${start_time}" --elapsed "10000" --top10 "${top10_msg}"