瀏覽代碼

增加从实验参数中获取阈值功能 未获取情况下使用全局阈值

gufengshou1 1 年之前
父節點
當前提交
2fae37bb83

+ 4 - 2
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/predict/model/threshold/ScoreV2ThresholdPredictModel.java

@@ -87,9 +87,11 @@ public class ScoreV2ThresholdPredictModel extends ThresholdPredictModel {
                 maxItem = item;
             }
         }
-
+        double realThreshold=Double.parseDouble(
+                scoreParam.getExtraParam().getOrDefault("ScoreV2ThresholdPredict_"+modelParam.getAppType(),threshold).toString()
+        );
         int adPredict;
-        if (maxItem != null && maxItem.getScore() < threshold) {
+        if (maxItem != null && maxItem.getScore() < realThreshold) {
             // If final score is below threshold, do not show the ad
             adPredict = 1;
         } else {