When Single-Dataset Conclusions Fail: A 45-Task Study of Threshold Tuning and Resampling for Imbalanced Classification
Organizations: Queensland University of Technology, Brisbane, Australia
Abstract
Class-imbalance handling is routinely evaluated on a single benchmark dataset, and the resulting conclusions are reported as if they were properties of the method. We show this practice is unsafe. On the public Kaggle credit-card fraud dataset, under a leakage-free nested cross-validation protocol in which the decision threshold is selected on a held-out inner validation fold, a plain Random Forest at the default 0.5 threshold attains F1 = 0.861 +/- 0.021, and threshold tuning yields it no benefit (delta-F1 = -0.002). Read alone, this supports an appealing conclusion: for a well-calibrated ensemble, imbalance handling is unnecessary. We then apply the identical protocol to 45 binary tasks spanning imbalance ratios from 1:1.5 to 1:178 (2,025 model fits, four model families). The conclusion reverses. Random Forest benefits most from threshold tuning across the suite (delta-F1 = +0.101 +/- 0.134), not least, while three other families replicate their fraud-dataset behaviour almost exactly. SMOTE likewise harms the fraud dataset but helps across the suite (mean delta-F1 = +0.076; 138 wins, 39 losses; Wilcoxon p = 2.7e-17). Two further results. Threshold-tuning benefit is non-monotonic in the imbalance ratio: near zero below 1:5, peaking at +0.120 in the 1:15-1:40 band, declining to +0.045 beyond 1:100 - explaining why the fraud dataset, at 1:577, is an unrepresentative place to study the question. And we reject an intuitive heuristic: validation-set calibration error does not predict tuning benefit (expected calibration error r = -0.087; Brier r = +0.137), so calibration diagnostics cannot tell a practitioner whether tuning is worthwhile. We release the protocol, the 45-task harness, and all per-run metrics.
Figures & tables
| Model | Strategy | F1 | AUPRC | ROC-AUC | R@P 0.90 | Threshold |
|---|---|---|---|---|---|---|
| Random Forest | plain | 0.861 0.021 | 0.847 | 0.973 | 0.819 | 0.500 |
| Random Forest | tuned threshold | 0.859 0.027 | 0.847 | 0.973 | 0.819 | 0.420 0.126 |
| Gradient Boosting | SMOTE + tuned | 0.842 0.041 | 0.792 | 0.972 | 0.633 | 0.984 0.006 |
| Random Forest | SMOTE + tuned | 0.838 0.028 | 0.837 | 0.979 | 0.776 | 0.730 0.040 |
| MLP | SMOTE + tuned | 0.820 0.022 | 0.823 | 0.961 | 0.740 | 0.984 0.009 |
| Logistic Regression | tuned threshold | 0.767 0.027 | 0.754 | 0.973 | 0.342 | 0.124 0.076 |
| Model family | F1, credit-card fraud | F1, 45-task suite | Agreement |
|---|---|---|---|
| Logistic Regression | +0.045 | +0.044 0.087 | replicates |
| Histogram Gradient Boosting | +0.057 | +0.057 0.091 | replicates |
| MLP | +0.015 | +0.035 0.071 | replicates |
| Random Forest | -0.002 | +0.101 0.134 | reverses |
| Strategy | Mean F1 | Median F1 | Wins | Losses | Wilcoxon p |
|---|---|---|---|---|---|
| Tuned threshold | +0.0592 | +0.0260 | 138 | 31 | |
| Class-balanced + tuned | +0.0547 | +0.0162 | 95 | 34 | |
| SMOTE + tuned | +0.0757 | +0.0260 | 138 | 39 |
| Imbalance ratio | Mean F1 | Std | n runs |
|---|---|---|---|
| < 1:5 | -0.0088 | 0.039 | 48 |
| 1:5 – 1:15 | +0.0454 | 0.092 | 192 |
| 1:15 – 1:40 | +0.1199 | 0.131 | 84 |
| 1:40 – 1:100 | +0.0996 | 0.131 | 72 |
| > 1:100 | +0.0447 | 0.060 | 144 |
| Statistic | Pearson r | p | Spearman | p |
|---|---|---|---|---|
| Expected calibration error (equal-width) | -0.087 | -0.075 | ||
| Expected calibration error (equal-frequency) | -0.060 | +0.032 | ||
| Brier score | +0.137 | +0.255 |
Class-Imbalanced Learning
Class-imbalanced learning develops classifiers that recognize rare classes without sacrificing performance on common ones.
See all 257 papers