|
@@ -107,18 +107,19 @@ def predict_ad_group_video(dt, config_key, config_param):
|
|
|
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 = {}
|
|
|
+ # 计算关怀模式实验阈值 并 写入Redis
|
|
|
+ care_model = config_param.get('care_model', None)
|
|
|
+ threshold_rate = config_param.get('threshold_rate', None)
|
|
|
+ if care_model is True:
|
|
|
+ care_model_threshold_data = {}
|
|
|
for key, val in threshold_data.items():
|
|
|
- up_val = val * up_rate
|
|
|
- up_threshold_data[key] = up_val
|
|
|
+ up_val = val * threshold_rate
|
|
|
+ care_model_threshold_data[key] = up_val
|
|
|
up_key_name = \
|
|
|
- f"{config_.KEY_NAME_PREFIX_AD_THRESHOLD}{abtest_id}:{abtest_config_tag}:{abtest_group}:{key}:up"
|
|
|
+ f"{config_.KEY_NAME_PREFIX_AD_THRESHOLD_CARE_MODEL}{abtest_id}:{abtest_config_tag}:{abtest_group}:{key}"
|
|
|
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}")
|
|
|
+ log_.info(f"config_key = {config_key}, abtest_group = {abtest_group}, "
|
|
|
+ f"care_model_threshold_data = {care_model_threshold_data}")
|
|
|
|
|
|
# predict_df.to_csv(f'./data/ad_user_video_predict_{config_key}.csv')
|
|
|
log_.info(f"config_key = {config_key} update end!")
|