How do you correct predicted probabilities back to the true class prior after undersampling?

Last updated 15 November 2026

  • Keeping a fraction β of negatives inflates the model's odds by 1/β. Correct with p = β·p_s / (β·p_s − p_s + 1), i.e. logit(p) = logit(p_s) + ln β (an intercept shift).

  • In general, reweight each class probability by π_true / π_train and renormalize. This also works for multiclass.

  • This is valid only for random undersampling of a calibrated model. NearMiss, ENN, or SMOTE change p(x|y), so recalibrate on real-distribution data. AUC is unchanged.

  • https://medium.com/data-science/how-to-calibrate-undersampled-model-scores-8f3319c1ea5b
All Imbalanced Datasets interview questions