Browse Source

Merge branch 'ad-abtest-threshold-auto-update-20221212' into pre-master

liqian 2 years ago
parent
commit
a438ff28e3
2 changed files with 33 additions and 33 deletions
  1. 2 2
      ad_threshold_auto_update.py
  2. 31 31
      config.py

+ 2 - 2
ad_threshold_auto_update.py

@@ -35,7 +35,7 @@ def get_threshold_record_new(ad_abtest_abcode_config, feature_df, threshold_reco
                 b_mean = temp_df[temp_df['adcode'].isin(ab_code_list)]['b'].mean()
                 if b_mean < 0:
                     threshold_param_new = float(threshold_record.get(ad_abtest_tag)) + threshold_update
-                elif b_mean > 10:
+                elif b_mean > 0.1:
                     threshold_param_new = float(threshold_record.get(ad_abtest_tag)) + threshold_update
                 else:
                     continue
@@ -114,7 +114,7 @@ def timer_check():
                          f"threshold_param_new: {threshold_record_new}\n"
             )
             log_.info(f"threshold update end!")
-        elif now_min > 45:
+        elif now_min > 30:
             log_.info('threshold update data is None!')
             send_msg_to_feishu(
                 webhook=config_.FEISHU_ROBOT['ad_threshold_auto_update_robot'].get('webhook'),

+ 31 - 31
config.py

@@ -813,17 +813,17 @@ class BaseConfig(object):
     # 广告模型abtest分组配置
     AD_ABTEST_ABCODE_CONFIG = {
         # 票圈vlog
-        APP_TYPE['VLOG']: {
-            'ab_test_id': 173,
-            'ab_test_config': {"a": ["ab1"], "b": ["ab3", "ab4", "ab6", "ab7", "ab8"], "c": [], "d": ["ab2"]},
-            'threshold_update': 1/24,
-        },
+        # APP_TYPE['VLOG']: {
+        #     'ab_test_id': 173,
+        #     'ab_test_config': {"a": ["ab1"], "b": ["ab3", "ab4", "ab6", "ab7", "ab8"], "c": [], "d": ["ab2"]},
+        #     'threshold_update': 1/24,
+        # },
         # 票圈视频+
-        APP_TYPE['PIAO_QUAN_VIDEO_PLUS']: {
-            'ab_test_id': 190,
-            'ab_test_config': {"a": ["ab1"], "b": ["ab6", "ab7", "ab2", "ab3"]},
-            'threshold_update': 1 / 24,
-        },
+        # APP_TYPE['PIAO_QUAN_VIDEO_PLUS']: {
+        #     'ab_test_id': 190,
+        #     'ab_test_config': {"a": ["ab1"], "b": ["ab6", "ab7", "ab2", "ab3"]},
+        #     'threshold_update': 1 / 24,
+        # },
         # 票圈视频
         APP_TYPE['LOVE_LIVE']: {
             'ab_test_id': 194,
@@ -831,30 +831,30 @@ class BaseConfig(object):
             'threshold_update': 1 / 12,
         },
         # 内容精选
-        APP_TYPE['LONG_VIDEO']: {
-            'ab_test_id': 195,
-            'ab_test_config': {"b": [], "c": ["ab1", "ab2"]},
-            'threshold_update': 1 / 24,
-        },
+        # APP_TYPE['LONG_VIDEO']: {
+        #     'ab_test_id': 195,
+        #     'ab_test_config': {"b": [], "c": ["ab1", "ab2"]},
+        #     'threshold_update': 1 / 24,
+        # },
         # 票圈短视频
-        APP_TYPE['SHORT_VIDEO']: {
-            'ab_test_id': 196,
-            'ab_test_config': {"a": [], "b": [], "c": ["ab2", "ab3", "ab1", "ab9"]},
-            'threshold_update': 1 / 24,
-        },
+        # APP_TYPE['SHORT_VIDEO']: {
+        #     'ab_test_id': 196,
+        #     'ab_test_config': {"a": [], "b": [], "c": ["ab2", "ab3", "ab1", "ab9"]},
+        #     'threshold_update': 1 / 24,
+        # },
         # 老好看视频
-        APP_TYPE['LAO_HAO_KAN_VIDEO']: {
-            'ab_test_id': 197,
-            'ab_test_config': {"a": ["ab0", "ab100", "ab6", "ab7", "ab8", "ab9"],
-                               "b": ["ab1", "ab2", "ab3",  "ab4", "ab5"]},
-            'threshold_update': 1 / 24,
-        },
+        # APP_TYPE['LAO_HAO_KAN_VIDEO']: {
+        #     'ab_test_id': 197,
+        #     'ab_test_config': {"a": ["ab0", "ab100", "ab6", "ab7", "ab8", "ab9"],
+        #                        "b": ["ab1", "ab2", "ab3",  "ab4", "ab5"]},
+        #     'threshold_update': 1 / 24,
+        # },
         # 票圈最惊奇
-        APP_TYPE['ZUI_JING_QI']: {
-            'ab_test_id': 198,
-            'ab_test_config': {"a": ["ab3", "ab6", "ab7"], "b": ["ab8", "ab9"]},
-            'threshold_update': 1 / 24,
-        },
+        # APP_TYPE['ZUI_JING_QI']: {
+        #     'ab_test_id': 198,
+        #     'ab_test_config': {"a": ["ab3", "ab6", "ab7"], "b": ["ab8", "ab9"]},
+        #     'threshold_update': 1 / 24,
+        # },
     }
 
     # 用户组有广告时的分享率预测结果存放 redis key 前缀,完整格式:ad:users:group:predict:share:rate:{user_data_key}:{user_rule_key}:{date}