imblearn.pipelinenot sklearn's — the difference between an honest CV score and a fantasy
sampling_strategy=0.5minority ends at half the majority · binary only · cleaning samplers reject it
'auto' flipsover → 'not majority' · under → 'not minority'
fit_resamplethe only entry point — no transform(), which is why sklearn's Pipeline rejects it
controlled ≠ cleaningcleaning samplers don't balance — stop waiting for 50:50
scale → resample → fitSMOTE is a Euclidean k-NN; unscaled, one feature owns the metric
BalancedRFpin sampling_strategy="all", replacement=True, bootstrap=False
class_weight firstthe free baseline you must beat before claiming SMOTE helped
PR-AUC, not ROC-AUCROC's FPR denominator is enormous when negatives dominate
StratifiedKFoldalways — plain KFold can hand you a fold with zero positives
SMOTENCraw categorical columns in, one-hot encode after — never before
test set stays skeweda balanced test set answers a question nobody asked
predict_proba liesafter SMOTE it's calibrated to a 50:50 world that doesn't exist
threshold tuningfree, invents nothing, often recovers all of it — try it first
no extrapolationSMOTE stays inside the convex hull — it redistributes, it never creates
count > ratio1:1000 with 5,000 positives is fine; 1:10 with 12 is a data problem