|
@@ -106,6 +106,20 @@ def predict_ad_group_video(dt, config_key, config_param):
|
|
|
for key, val in threshold_data.items():
|
|
|
key_name = f"{config_.KEY_NAME_PREFIX_AD_THRESHOLD}{abtest_id}:{abtest_config_tag}:{abtest_group}:{key}"
|
|
|
redis_helper.set_data_to_redis(key_name=key_name, value=val, expire_time=2 * 24 * 3600)
|
|
|
+
|
|
|
+ # 计算比常态阈值较低阈值 并 写入Redis
|
|
|
+ up_threshold_flag = config_param.get('up_threshold_flag', None)
|
|
|
+ up_rate = config_param.get('up_rate', None)
|
|
|
+ if up_threshold_flag is True:
|
|
|
+ up_threshold_data = {}
|
|
|
+ for key, val in threshold_data.items():
|
|
|
+ up_val = val * up_rate
|
|
|
+ up_threshold_data[key] = up_val
|
|
|
+ up_key_name = \
|
|
|
+ f"{config_.KEY_NAME_PREFIX_AD_THRESHOLD}{abtest_id}:{abtest_config_tag}:{abtest_group}:{key}:up"
|
|
|
+ redis_helper.set_data_to_redis(key_name=up_key_name, value=up_val, expire_time=2 * 24 * 3600)
|
|
|
+ log_.info(f"config_key = {config_key}, abtest_group = {abtest_group}, up_threshold_data = {up_threshold_data}")
|
|
|
+
|
|
|
# predict_df.to_csv(f'./data/ad_user_video_predict_{config_key}.csv')
|
|
|
log_.info(f"config_key = {config_key} update end!")
|
|
|
|