A payment-fraud detector may see thousands of legitimate transactions for every fraudulent one. Resampling changes the composition of its training data so the rare fraud class has more influence. Without an imbalance strategy, a model can achieve high overall accuracy by approving nearly everything while missing fraud. section 8.1.1
Two common approaches change the class balance in opposite ways:
- Oversampling increases representation of the minority fraud class. SMOTE generates synthetic fraud examples. section 8.1.1
- Undersampling reduces representation of the majority legitimate class by removing transactions. section 8.1.1
Keep resampling inside the modeling pipeline, after partitioning the data. Applying it before cross-validation can let synthetic fraud examples contaminate validation folds and inflate performance estimates. Leave the test set untouched at its original class balance. Cost-sensitive learning is a separate option: it increases the penalty for missed fraud instead of changing the dataset. section 8.2.2 section 8.1.1
Check the fraud-detection split
A stratified 70/30 split retains approximately 0.1725% fraud in both training and test sets. Resample only for training; evaluate against the unchanged test set using precision, recall, and F1 rather than accuracy alone. A model that approves every transaction could score 99% accuracy while catching no fraud. section 8.2.2 section 8.1.1


