zhaohaipeng 7 mesi fa
parent
commit
99e78184ee

+ 10 - 6
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV562.java

@@ -422,7 +422,7 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
             // todo 线性加权 预测VoV
 
 
-            double vov_p = calculateScore(featureList, weightList, vov_thresh, view_thresh, h1_ago_view,level50_vov,level_95_vov,beta_vov);
+            double vov_p = calculateScore(featureList, weightList,item,  vov_thresh, view_thresh, h1_ago_view,level50_vov,level_95_vov,beta_vov);
 
 
             double hasReturnRovScore = Double.parseDouble(vid2MapFeature.getOrDefault(item.getVideoId() + "", new HashMap<>())
@@ -455,17 +455,19 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
     }
 
 
-    private  double calculateScore(List<Double> featureList, List<Double> weightList,
+    private  double calculateScore(List<Double> featureList, List<Double> weightList,RankItem rankItem,
                                         double vov_thresh, double view_thresh, double h1_ago_view,double level50_vov,double level_95_vov,double beta_vov) {
         // 检查 h1_ago_view 条件
         if (h1_ago_view == -2 || h1_ago_view == -1 || h1_ago_view < view_thresh) {
+            rankItem.getScoresMap().put("origin_vov_p", 0d);
             return 0;
         }
 
-        // 检查 featureList 是否全为 -1
-        if (featureList.stream().allMatch(f -> f == -1)) {
-            return 0;
-        }
+        // // 检查 featureList 是否全为 -1
+        // if (featureList.stream().allMatch(f -> f == -1)) {
+        //     rankItem.getScoresMap().put("origin_vov_p", 0d);
+        //     return 0;
+        // }
 
         // 计算有效特征的总权重和得分
         double score = 0;
@@ -479,6 +481,7 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
 
         // 如果没有有效特征,返回 0
         if (validIndices.isEmpty()) {
+            rankItem.getScoresMap().put("origin_vov_p", 0d);
             return 0;
         }
 
@@ -487,6 +490,7 @@ public class RankStrategy4RegionMergeModelV562 extends RankStrategy4RegionMergeM
             double weight = weightList.get(index);
             score += featureList.get(index) * weight;
         }
+        rankItem.getScoresMap().put("origin_vov_p", score);
         // 调整vov
         if (score < vov_thresh) {
             score = 0;