Browse Source

add RULE_PARAMS_REGION: rule3 < view_type: video-show-region >

liqian 2 years ago
parent
commit
a0423dfddd
2 changed files with 5 additions and 1 deletions
  1. 1 0
      config.py
  2. 4 1
      region_rule_rank_h.py

+ 1 - 0
config.py

@@ -123,6 +123,7 @@ class BaseConfig(object):
     RULE_PARAMS_REGION = {
         # 'rule1': {'view_type': 'pre-view', 'platform_return_rate': 0.001, 'region_24h_rule_key': 'rule1'},
         'rule2': {'view_type': 'video-show', 'platform_return_rate': 0.001, 'region_24h_rule_key': 'rule2'},
+        'rule3': {'view_type': 'video-show-region', 'platform_return_rate': 0.001, 'region_24h_rule_key': 'rule2'},
     }
 
     # 地域分组天级规则更新使用数据

+ 4 - 1
region_rule_rank_h.py

@@ -67,7 +67,8 @@ features = [
     'lastonehour_play_total',  # 过去1小时播放次数
     'lastonehour_share_total',  # 过去1小时分享次数
     'platform_return',
-    'lastonehour_show',
+    'lastonehour_show',  # 不区分地域
+    'lastonehour_show_region',  # 地域分组
 ]
 
 
@@ -147,6 +148,8 @@ def cal_score(df, param):
     df['log_back'] = (df['lastonehour_return'] + 1).apply(math.log)
     if param.get('view_type', None) == 'video-show':
         df['ctr'] = df['lastonehour_play'] / (df['lastonehour_show'] + 1000)
+    elif param.get('view_type', None) == 'video-show-region':
+        df['ctr'] = df['lastonehour_play'] / (df['lastonehour_show_region'] + 1000)
     else:
         df['ctr'] = df['lastonehour_play'] / (df['lastonehour_preview'] + 1000)
     df['K2'] = df['ctr'].apply(lambda x: 0.6 if x > 0.6 else x)