Class Imbalance Lab
See why high accuracy can hide weak minority-class detection, and why resampling belongs inside the training workflow rather than on the evaluation set.
What to observe while you experiment
Class imbalance changes what “good performance” means because a majority-class prediction can achieve high accuracy while missing the minority class almost entirely. The lab separates prevalence, decision threshold and resampling so their effects can be inspected independently.
Experiment deliberately
Create a highly imbalanced case, predict what a majority-only classifier would score, then compare accuracy with recall and PR-oriented evidence.
Evaluation set remains untouched. Only the training rows are resampled. The test prevalence therefore reflects the original problem.
Generating imbalanced classification problem…