Browse Source

add 173-u 策略

yangxiaohui 1 year ago
parent
commit
3ede4f68a5
2 changed files with 10 additions and 2 deletions
  1. 3 2
      ad_recommend.py
  2. 7 0
      config.py

+ 3 - 2
ad_recommend.py

@@ -307,7 +307,7 @@ def predict_mid_video_res_with_model(now_date, mid, video_id, abtest_param, abte
         user_score = 0.0
     if item_score is None:
         item_score = 0.0
-    mid_video_predict_res = user_score + item_score
+    final_score = user_score + item_score
 
     # 获取对应的阈值
     threshold_key_name_prefix = config_.KEY_NAME_PREFIX_AD_THRESHOLD
@@ -316,7 +316,7 @@ def predict_mid_video_res_with_model(now_date, mid, video_id, abtest_param, abte
     threshold = 0.2
 
     # 阈值判断
-    if mid_video_predict_res > threshold:
+    if final_score > threshold:
         # 大于阈值,出广告
         ad_predict = 2
     else:
@@ -325,6 +325,7 @@ def predict_mid_video_res_with_model(now_date, mid, video_id, abtest_param, abte
     result = {
         'user_score': user_score,
         'item_score': item_score,
+        'final_score': final_score,
         'threshold': threshold,
         'ad_predict': ad_predict
     }

+ 7 - 0
config.py

@@ -1171,6 +1171,13 @@ class BaseConfig(object):
             }
         },  # 所有广告类型数据 + 优化阈值计算方式 + else未开启关怀模式人群多出广告 + 使用以是否直接跳出为目标的数据 + return25_nmids用户不出广告 + 所有用户组top3不出广告
 
+        '173-u': {
+            'threshold_mix_func': 'model',
+            'model_key': 'ad_out_v2_model_v1.day',
+        },  # 是否出广告模型预测
+
+
+
         # 票圈视频+
         # '190-a': {
         #     'video': {'data': 'data1'},