Kaynağa Gözat

update ad threshold auto update

liqian 2 yıl önce
ebeveyn
işleme
903fe3729e
2 değiştirilmiş dosya ile 16 ekleme ve 6 silme
  1. 4 4
      ad_threshold_auto_update.py
  2. 12 2
      config.py

+ 4 - 4
ad_threshold_auto_update.py

@@ -40,14 +40,14 @@ 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:
                     # 阈值按梯度调高
-                    gradient = up_threshold_update.get('gradient')
-                    update_range = up_threshold_update.get('update_range')
+                    gradient = up_threshold_update[config_name].get('gradient')
+                    update_range = up_threshold_update[config_name].get('update_range')
                     b_i = (b_mean * -1) // gradient + 1
                     threshold_param_new = float(threshold_record.get(ad_abtest_tag)) + update_range * b_i
                 elif b_mean > 0.1:
                     # 阈值按梯度调低
-                    gradient = up_threshold_update.get('gradient')
-                    update_range = up_threshold_update.get('update_range')
+                    gradient = down_threshold_update[config_name].get('gradient')
+                    update_range = down_threshold_update[config_name].get('update_range')
                     b_i = (b_mean - 0.1) // gradient + 1
                     threshold_param_new = float(threshold_record.get(ad_abtest_tag)) - update_range * b_i
                 else:

+ 12 - 2
config.py

@@ -833,8 +833,18 @@ class BaseConfig(object):
         APP_TYPE['LOVE_LIVE']: {
             'ab_test_id': 194,
             'ab_test_config': {"a": ["ab6", "ab7", "ab8"], "b": ["ab3", "ab4"], "c": ["ab2"], "d": ["ab1"]},
-            'up_threshold_update': {'gradient': 0.05, 'update_range': 1 / 24},
-            'down_threshold_update': {'gradient': 0.1, 'update_range': 1 / 12},
+            'up_threshold_update': {
+                'a': {'gradient': 0.05, 'update_range': 1 / 24},
+                'b': {'gradient': 0.05, 'update_range': 1 / 24},
+                'c': {'gradient': 0.05, 'update_range': 1 / 192},
+                'd': {'gradient': 0.05, 'update_range': 1 / 192},
+            },
+            'down_threshold_update': {
+                'a': {'gradient': 0.1, 'update_range': 1 / 12},
+                'b': {'gradient': 0.1, 'update_range': 1 / 12},
+                'c': {'gradient': 0.1, 'update_range': 1 / 12},
+                'd': {'gradient': 0.1, 'update_range': 1 / 12},
+            },
         },
         # 内容精选
         # APP_TYPE['LONG_VIDEO']: {