ml_dl.balance_pos_neg
ml_dl.balance_pos_neg(X, y, max_ratio=5, seed=42)Random under-sampling of the majority (negative) class.
Caps the negative-to-positive ratio at max_ratio. Shuffles the survivor indices before returning so a downstream classifier sees a well-mixed feed.