liqian il y a 2 ans
Parent
commit
0642e6d922
2 fichiers modifiés avec 8 ajouts et 5 suppressions
  1. 7 4
      ad_threshold_auto_update.py
  2. 1 1
      config.py

+ 7 - 4
ad_threshold_auto_update.py

@@ -38,18 +38,21 @@ def get_threshold_record_new(ad_abtest_abcode_config, feature_df, threshold_reco
             if len(ab_code_list) > 0:
                 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
+                    # 阈值按梯度调高
+                    b_i = (b_mean * -1)//0.05 + 1
+                    threshold_param_new = float(threshold_record.get(ad_abtest_tag)) + threshold_update * b_i
                 elif b_mean > 0.1:
                     # 阈值调低
                     threshold_param_new = float(threshold_record.get(ad_abtest_tag)) - threshold_update
+                    b_i = 1
                 else:
                     continue
                 if threshold_param_new > 0:
                     threshold_record_new[ad_abtest_tag] = threshold_param_new
                     robot_msg_record.append({'appType': app_type, 'ad_abtest_tag': ad_abtest_tag,
-                                             'param_old': float(threshold_record.get(ad_abtest_tag)),
-                                             'param_new': threshold_param_new})
+                                             'b_i': int(b_i), 'gradient': round(threshold_update, 4),
+                                             'param_old': round(float(threshold_record.get(ad_abtest_tag)), 4),
+                                             'param_new': round(threshold_param_new, 4)})
     return threshold_record_new, robot_msg_record
 
 

+ 1 - 1
config.py

@@ -828,7 +828,7 @@ 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"]},
-            'threshold_update': 1 / 12,
+            'threshold_update': 1 / 24,
         },
         # 内容精选
         # APP_TYPE['LONG_VIDEO']: {