|
@@ -85,7 +85,7 @@ def get_predict_calibration_file(df: pd.DataFrame, predict_basename: str) -> [pd
|
|
|
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'
|
|
|
save_full_calibration_file(agg_df, f"{SEGMENT_BASE_PATH}/{predict_basename}.txt")
|
|
|
- calibration = agg_df.query(condition)
|
|
|
+ calibration = agg_df[(agg_df['view'] > 1000) & ((agg_df['diff_rate'] >= 0.2) | (agg_df['diff_rate'] <= 0.2)) & agg_df['diff_rate'] != 0]
|
|
|
return calibration
|
|
|
|
|
|
|