| 
					
				 | 
			
			
				@@ -7,7 +7,8 @@ source /root/anaconda3/bin/activate py37 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 # 原始数据table name 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 table='alg_recsys_sample_all' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-today="$(date +%Y%m%d)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#today="$(date +%Y%m%d)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+today=20240710 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #today_early_3="$(date -d '3 days ago' +%Y%m%d)" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 today_early_3=20240703 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #table='alg_recsys_sample_all_test' 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -42,12 +43,12 @@ HADOOP=/opt/apps/HADOOP-COMMON/hadoop-common-current/bin/hadoop 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 # 0 对比AUC 前置对比2日模型数据 与 线上模型数据效果对比,如果2日模型优于线上,更新线上模型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 echo "$(date +%Y-%m-%d_%H-%M-%S)----------step4------------开始对比,新:${MODEL_PATH}/${model_name}_20240703.txt,与线上online模型数据auc效果" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-$HADOOP fs -text ${bucketDataPath}/20240707/* | ${FM_HOME}/fm_predict -m ${LAST_MODEL_HOME}/model_online.txt -dim 8 -core 8 -out ${PREDICT_PATH}/${model_name}_${today}_online.txt 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#$HADOOP fs -text ${bucketDataPath}/20240707/* | ${FM_HOME}/fm_predict -m ${LAST_MODEL_HOME}/model_online.txt -dim 8 -core 8 -out ${PREDICT_PATH}/${model_name}_${today}_online.txt 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 if [ $? -ne 0 ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   echo "推荐线上模型AUC计算失败" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   /root/anaconda3/bin/python monitor_util.py --level error --msg "荐模型数据更新 \n【任务名称】:step4新旧模型AUC对比\n【是否成功】:error\n【信息】:推荐线上模型AUC计算失败" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  $HADOOP fs -text ${bucketDataPath}/20240707/* | ${FM_HOME}/fm_predict -m ${MODEL_PATH}/${model_name}_20240703.txt -dim 8 -core 8 -out ${PREDICT_PATH}/${model_name}_${today}_new.txt 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#  $HADOOP fs -text ${bucketDataPath}/20240707/* | ${FM_HOME}/fm_predict -m ${MODEL_PATH}/${model_name}_20240703.txt -dim 8 -core 8 -out ${PREDICT_PATH}/${model_name}_${today}_new.txt 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if [ $? -ne 0 ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      echo "推荐新模型AUC计算失败" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      /root/anaconda3/bin/python monitor_util.py --level error --msg "荐模型数据更新 \n【任务名称】:step4新旧模型AUC对比\n【是否成功】:error\n【信息】:推荐新模型AUC计算失败${PREDICT_PATH}/${model_name}_${today}_new.txt" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -73,9 +74,9 @@ else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     split($0, fields, " "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     OFS="\t"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    line="" 1; i <= 10 && i <= length(fields); i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        line 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    for (i = = (line ? line "\t" : "") fields[i]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    line="" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    for (i = 1; i <= 10 && i <= length(fields); i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        line = (line ? line "\t" : "") fields[i]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     print line 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 |