|
@@ -95,13 +95,19 @@ def get_threshold_record_new_by_uv(ad_abtest_abcode_config, feature_df, threshol
|
|
|
|
|
|
threshold_param_old = threshold_record_old[ab_test_group].get('group')
|
|
|
if uv_differ < 0:
|
|
|
-
|
|
|
- step = math.ceil((uv_differ * -1) / gradient)
|
|
|
+
|
|
|
+ if abs(uv_differ) < gradient:
|
|
|
+ step = math.ceil(abs(uv_differ) / gradient)
|
|
|
+ else:
|
|
|
+ step = round(abs(uv_differ) / gradient)
|
|
|
step = max_update_step if step > max_update_step else step
|
|
|
threshold_param_new = float(threshold_param_old) - update_range * step
|
|
|
elif uv_differ > 0:
|
|
|
-
|
|
|
- step = math.ceil(uv_differ / gradient)
|
|
|
+
|
|
|
+ if uv_differ < gradient:
|
|
|
+ step = math.ceil(uv_differ / gradient)
|
|
|
+ else:
|
|
|
+ step = round(uv_differ / gradient)
|
|
|
step = max_update_step if step > max_update_step else step
|
|
|
threshold_param_new = float(threshold_param_old) + update_range * step
|
|
|
else:
|