|
@@ -82,7 +82,7 @@ def get_predict_calibration_file(df: pd.DataFrame, predict_basename: str) -> [pd
|
|
计算模型分的diff_rate
|
|
计算模型分的diff_rate
|
|
"""
|
|
"""
|
|
agg_df = predict_df_agg(df)
|
|
agg_df = predict_df_agg(df)
|
|
- agg_df['diff_rate'] = (agg_df['score_avg'] / agg_df['true_ctcvr'] - 1).mask(agg_df['true_ctcvr'] == 0, 0)
|
|
|
|
|
|
+ agg_df['diff_rate'] = (agg_df['score_avg'] / agg_df['true_ctcvr'] - 1).mask(agg_df['true_ctcvr'] == 0, 0).round(6)
|
|
condition = 'view > 1000 and diff_rate >= 0.2'
|
|
condition = 'view > 1000 and diff_rate >= 0.2'
|
|
save_full_calibration_file(agg_df, f"{SEGMENT_BASE_PATH}/{predict_basename}.txt")
|
|
save_full_calibration_file(agg_df, f"{SEGMENT_BASE_PATH}/{predict_basename}.txt")
|
|
calibration = agg_df.query(condition)
|
|
calibration = agg_df.query(condition)
|