Do Imbalance Corrections Help or Only Distort Risk? A Replication and Extension with Logistic Regression and Gradient Boosting on Three Clinical Tabular Data Sets Deneb-72D Stemma seed corpus https://github.com/mihir-chauhan/research-harness-papers/tree/main/papers/class-imbalance-calibration-clinical-tabular Abstract—Class-imbalance corrections change the training I. Introduction prevalence of clinical risk models and may distort predicted risks. This is a small, reproducible replication and extension Clinical prediction models are used to estimate an of earlier findings for logistic regression [1], not a new result individual’s risk of an event, and the usefulness of that for LR. We compare no correction, class reweighting, random oversampling (ROS), SMOTE and decision-threshold moving estimate depends on both how well it ranks patients for logistic regression (LR) and gradient boosting (GB) on (discrimination) and whether a predicted risk of, say, five breast cancer Wisconsin (natural prevalence and training per cent corresponds to about five per cent of such patients positives subsampled to 1:5, 1:20 and 1:50), Pima diabetes having the event (calibration) [2]. Rare outcomes make and mammography, over 10 random splits with prevalence- the training data imbalanced, and it is common practice matched weighted evaluation; this revision corrected the 1:20 test weights and added Holm adjustment, equal-budget tun- to “correct” this by reweighting classes, oversampling ing, Platt and isotonic recalibration, a loss-weight control, the minority class, synthesising minority examples with a specificity-matched cut-off and a simulation. On breast SMOTE [3], or moving the decision threshold. Such cancer, no improvement in discrimination was detected for LR corrections are widely available in software [4], [5], but (AUROC differs from no correction by at most 0.003); the 1:5 they alter the prevalence seen by the learner, so the output LR losses in AUROC, AUPRC and Brier score (unadjusted p = 0.03–0.05) and the GB ROS 1:5 AUPRC gain do not of a corrected model is not a risk estimate for the target survive Holm adjustment. With tuned GB, small AUPRC population unless it is mapped back [6]. gains appear in 4 of 12 cells, and on mammography the Prior work, and what this study is. The central findings corrections raise AUROC (GB by about 0.014), so “no gain” for logistic regression were reported before this study. van is not general. For LR every correction lowers the signed calibration intercept in all 12 breast-cancer cells (all surviving den Goorbergh et al. [1] examined random undersampling, Holm), turning underestimation into overestimation, while the random oversampling and SMOTE with standard and absolute intercept and Brier score barely move there; on Pima ridge logistic regression in Monte Carlo simulations and and mammography the corrections raise LR Brier score and |a| an ovarian-cancer case study, and found strong overesti- clearly. Corrections raise LR sensitivity at the default cut-off, mation of the probability of the minority class, no better but at a cut-off matched on specificity to threshold moving the LR balanced-accuracy difference to threshold moving is at AUROC, and sensitivity and specificity improvements that most 0.010 and not significant, so that advantage is a cut- a shifted probability threshold reproduces. Carriero et al. off effect. The analytic prior-shift offset fails on breast cancer studied the effect of corrections on calibration for a variety (higher |a| in all 24 cells) but restores LR calibration on Pima of machine-learning algorithms in simulations that vary and mammography and in a simulation of a correctly specified sample size, predictors and event fraction and found over- model, except when classes are nearly separable and the penalty strong. Platt scaling brings corrected models back to about the estimation of risk that re-calibration could not always calibration of no correction, not past it. Conclusions are limited remove [7]; Andersen et al. evaluated SMOTE, random to three data sets and 10 seeds. undersampling and ROS at 1:1 on ten real clinical datasets Index Terms—class imbalance, calibration, SMOTE, clini- with several model families [8]; and Sirikul et al. studied cal prediction models, logistic regression, gradient boosting, penalised logistic regression on GUSTO-I-derived data and threshold moving report that corrections failed to enhance discrimination, Deneb-72D is the codename of an autonomous study, not a person. calibration and prediction stability [9]. Our results for LR Produced by the Stemma autonomous AI research pipeline; the topic on breast cancer (no detected AUROC gain, a shift of was chosen to cover the field. Every reported number comes from logged runs in the linked repository and every reference was checked predicted risk toward overestimation, and a sensitivity against arXiv, Crossref, DataCite or OpenAlex. gain at the default cut-off) reproduce the findings of [1] and are not new; we do not claim them as such. This bration error [2]; we use the Brier score and the logistic paper is a replication and extension on small public data recalibration slope and intercept instead, since binned with a gradient-boosting learner added. What it adds error depends on the binning. Gradient boosting [10] is to that literature, each item tested in a section below: the learner behind tools such as XGBoost [11]; we use (i) a comparison of the corrected models with threshold scikit-learn’s implementation [5], with fixed settings in the moving at a cut-off matched on specificity (Section VII); main groups and a tuned grid in the controls. (ii) a test of the analytic prior-shift offset, which fails III. Method on breast cancer, with a controlled simulation and two further data sets in which it works for LR (Sections VI Let x ∈ R be standardised features and y ∈ {0, 1} the 30 and VIII); (iii) equal-budget tuning and Platt or isotonic outcome (1 = malignant), with realised training prevalence recalibration arms (Section VII); and (iv) Holm-adjusted π = ȳtrain . A learner outputs p̂(x) = Pr(y=1 | x) as fitted tests, which reduce several isolated p < 0.05 results of on the (possibly modified) training set. All systems share the first version to suggestions. The scope remains small: the learner and its hyperparameters; they differ only in three data sets, ten seeds, a few learners. the training data, the loss ∑weights or the decision rule. We study the seed question “which corrections help dis- Learners. LR minimises i ℓ(yi , σ(w⊤ xi + b)) + 2C 1 ∥w∥2 crimination and which only distort predicted risk?” with with C = 1 and log-loss ℓ. GB is Friedman’s gradient four hypotheses registered before the main runs (H1–H4, boosting machine [10] with log-loss, 100 trees of depth Section IV). Contributions: (i) a controlled comparison 3, learning rate 0.1 and no subsampling (the controls of of five strategies, two learners and four prevalences on Section IV vary C, depth, leaf size and subsampling). discrimination, calibration and operating point, with 10 Class reweighting. Each example gets weight ωc = seeds per cell, reproducing known effects; (ii) the controls n/(2n∑c ), so both classes carry total weight n/2: and added data sets listed above; (iii) an account of min i ωyi ℓ(yi , p̂(xi )) (LR class_weight / GB sam- where the comparison is uninformative. We claim no new ple_weight). The effective training prevalence is πeff = 0.5. method. Random oversampling (ROS). Draw m = round(r n0 ) − n1 minority rows with replacement and append them, with II. Related Work target ratio r = 1 unless stated (n0 , n1 : majority and Imbalance corrections. SMOTE creates synthetic minor- minority training counts). πeff is the realised prevalence ity examples by interpolating between a minority point of the resampled set, which is 0.5 at r = 1. and one of its k nearest minority neighbours [3]; the SMOTE (reimplemented). For each of imbalanced-learn toolbox packages SMOTE and many m = round(r n0 ) − n1 synthetic points, pick a minority variants [4]. We reimplement SMOTE and ROS in point xa uniformly, pick uniformly one of its k = 5 NumPy. nearest minority neighbours xb (Euclidean distance in Effects on calibration and the closest prior work. Dal standardised space; k = min(5, n1 − 1) if fewer minority Pozzolo et al. analyse how undersampling biases posterior points), draw u ∼ U (0, 1) and set xnew = xa + u (xb − xa ) probabilities and propose a correction of the posterior [6]; with label 1 [3]. our prior-shift offset (Section III) applies the same prior- Threshold moving. Fit with no correction, then classify ratio argument to oversampling and reweighting. The as positive if p̂(x) ≥ π instead of 0.5. The probabilities, closest prior study is van den Goorbergh et al. [1]: standard hence all probability metrics, are those of no correction and ridge logistic regression with random undersampling, by construction (the equality of its AUROC, AUPRC, random oversampling and SMOTE, Monte Carlo simula- Brier score and slope with no correction checks the tion and an ovarian-cancer case study; calibration became implementation and is not an empirical finding); only poor (strong overestimation of the minority-class proba- sensitivity and specificity change. bility), AUROC did not improve, and the sensitivity and Prior-shift offset (ablation). A model fitted at preva- specificity gains were matched by shifting the probability lence πeff but deployed at π has, under the prior-shift threshold. Our LR results on breast cancer (Section V) assumption, corrected logit [6] agree with each of these three findings; relative to that π logit p̃(x) = logit p̂(x) + log 1−π − log 1−π πeff . (1) study we add a gradient-boosting learner, a threshold- eff moving arm evaluated also at a cut-off matched on The map is monotone, so it changes no ranking metric, specificity, an offset test, tuning and recalibration controls, except that the code applies it to p̂ clipped to [ϵ, 1 − ϵ] and two further clinical data sets; we do not study with ϵ = 1 × 10−6 , which can tie saturated predictions. undersampling, which they do. The three studies [7]–[9] Metrics. With test weights wi (Section IV): AUROC cover more learners, event fractions and real data sets than and AUPRC (average precision) ∑ computed∑with sam- i wi (p̂i − yi ) / ours; ours is much smaller. 2 ple weights; Brier score i wi ; cali- Calibration metrics and learners. Guo et al. document bration slope b from the weighted logistic regression miscalibration of modern neural networks, find temper- logit Pr(y=1) = a0 + b logit p̂ (scikit-learn, C = 1 × 106 , ature scaling effective and use the binned expected cali- i.e. effectively unpenalised), where p̂ is clipped to [ϵ, 1 − ϵ] (b = 1 is ideal; b < 1 means predictions are too raphy tasks) × 10 seeds (0–9; each seed changes the split, extreme); ∑ ( and calibration-in-the-large ) a, the offset solving the positive subsample and the resampling randomness): w i i iy − σ(logit p̂ i + a) = 0, searched in [−20, 20] 900 runs of method/run.py in group main with identical (a = 0 is ideal; a > 0 means risks are underestimated, code, data pipeline and metric definitions. In the main a < 0 overestimated). We rank by |b − 1| and |a| and also groups hyperparameters are fixed (Section III); no system report the signed values. Sensitivity and specificity use the is tuned, so the tuning budget is equal (zero). Correction system’s decision threshold (0.5; π for threshold moving). target ratio is 1:1 unless stated. Ablations: the prior-shift offset on reweighting, ROS and SMOTE for both learners IV. Experimental Setup and all tasks (240 runs), and a sweep of the SMOTE Data and tasks. Breast cancer Wisconsin (diagnos- target ratio r ∈ {0.10, 0.25, 0.50, 0.75} plus the main runs tic) from scikit-learn: 569 patients, 30 numeric features at r = 1, both learners, at 1:20 (80 runs). Reference arm computed from digitised images of fine-needle aspirates (“method” in the run registry): LR with no correction. of breast masses (cell-nucleus size, shape and texture), Controls added in round 1. All use the same splits, seeds 212 malignant (positive) and 357 benign. It is a tab- and metrics (breast cancer, four tasks, 10 seeds) and the ular diagnostic data set with one row per patient; it same budget for every system: (i) Equal-budget tuning is not electronic-health-record data and not a clinical (group ctrl_tuned, all five strategies, both learners): an time series. Task bc_natural uses the data as is. For inner stratified 3-fold cross-validation on the training split ratios k ∈ {5, 20, 50} (bc_1to5, bc_1to20, bc_1to50) chooses the hyperparameters from a fixed grid, with the we make the training set imbalanced: after a stratified same grid, folds and criterion for every system: the pooled 70/30 split (seeded), training positives are subsampled to held-out log-loss on the unresampled held-out folds (the n1 = round(n0 /k), which gives 50, 12 and 5 positives system, including any resampling, is refitted on each in every split (the natural split has 148). Subsampling training part). The grid is five values of C for LR, from the whole data to 1:50 would leave about 7 positives 0.01 to 100 in steps of a factor ten and, for GB with in total, so every held-out example is kept (64 malig- 100 trees and learning rate 0.1, tree depth {1, 2, 3}× nant, 107 benign) and the test positives get a common minimum leaf size {1, 10}× subsample fraction {0.5, 1} weight w so that the weighted test prevalence equals (12 points). Ties go to the first grid point. The selected the realised ( training prevalence π = n1 /(n0 + n1 ), i.e. ) test hyperparameters are logged with each run. (ii) Recali- w = ntest 0 n 1 /n 0 /n 1 ; all metrics are weighted. The bration (groups ctrl_recal_platt, ctrl_recal_isotonic; no nominal ratio 1:k and the realised prevalence differ only correction, reweighting, ROS and SMOTE, both learners, at k = 20: there n0 = 250, n1 = 12 and π = 12/262 (odds default hyperparameters): a Platt (logistic on the logit about 1:21). Round 1 of this study used the nominal ratio of the risk, effectively unpenalised) or isotonic map is for the test weights, so at 1:20 the evaluation prevalence fitted on out-of-fold risks of the training split (3 folds; was 1/21 while the threshold and the prior-shift offset the system is refitted on each training part and applied used π; all runs of the main, offset and sweep groups were to the untouched held-out part), then applied to the rerun with the realised prevalence (the earlier rows are risks of the model fitted on the whole training split. superseded in results/runs.jsonl), and the numbers below The test split is never used. (iii) Normalised loss weight are from the rerun. Weighting tests calibration at the (group ctrl_normw, LR with ROS or SMOTE): every deployment prevalence but reduces the effective number row of the resampled set gets weight ntrain /nfit so that of positives at 1:50 (Limitations). the total loss weight equals that of the original training Clinical data sets with lower discrimination (added in set and of balanced reweighting (which sums to ntrain ). round 1). Pima Indians diabetes (OpenML id 37, 768 (iv) Specificity-matched cut-off (group ctrl_opmatch, the women, 8 clinical measurements, 268 with diabetes; zeros three corrections, both learners): for each run, thresh- are kept as in the source) is run with the same four old moving’s operating point is computed (no-correction tasks as above (pima_natural, pima_1to5, pima_1to20, model, cut-off π), and the corrected model is evaluated at pima_1to50; the positives are subsampled in the training the smallest cut-off whose weighted specificity is at least split as for breast cancer). Mammography (OpenML that of threshold moving. This uses the test labels to pick id 310, 11183 examinations, 6 image-derived attributes, the cut-off and is a diagnostic, not a deployable rule. 260 positive, event rate about two per cent) is already Simulation (added in round 1). Group sim_offset imbalanced and is run at its natural prevalence only (method/sim.py): √ x ∼ N (0, I10 ), true risk σ(a0 + ∑ features (mammo_natural, unweighted test split). Both are fetched s z) with z = j xj / 10, a correctly specified logistic from OpenML with scikit-learn (the cached copy lives in model, with a0 set so that the prevalence is 0.05. Training the git-ignored data/ directory). The protocol is that of size n ∈ {250, 1000, 4000} (about a dozen, fifty and the main groups: systems of Table I (10 arms), the prior- two hundred positives), signal strength s ∈ {1, 2, 4, 8} shift offset on reweighting, ROS and SMOTE. (from a weak to a near-separable true risk), LR penalty Systems and protocol. Five strategies × two learners × C ∈ {0.01, 1, 100}, 20 seeds per cell, a test sample of 20000 four breast-cancer tasks (and the five Pima and mammog- iid rows at the natural prevalence (unweighted). In each run LR is fitted with no correction, reweighting, ROS and for GB (AUROC −0.028 to −0.044, AUPRC −0.068 to SMOTE, each raw and with the prior-shift offset. −0.085), again not significant (for GB at 1:20 and 1:50 Statistics. Differences to the same learner without the smallest p of any AUROC difference is 0.28 and of any correction are paired by seed, with a two-sided paired t- AUPRC difference 0.23). With 10 seeds and a seed sd of test. Unadjusted p-values are reported with Holm-adjusted 0.11 or more in GB AUPRC, a non-significant difference ones: within each family of tests (one metric across does not exclude a gain of the registered size; we state all learner × correction × task cells of one data set; that no improvement in discrimination was detected, not threshold-moving comparisons by metric and reference that none exists. set) the Holm step-down procedure gives the adjusted p. H2 (corrections worsen Brier score and |a| at 1:20 and The families are defined in analysis/derive.py. All derived 1:50): direction as predicted for Brier but not significant; statistics are computed by that script, logged through rh not supported for |a|. Brier score is higher with a correc- run (group derived) and quoted from the registry. The tion in 12 of the 12 cells at 1:20 and 1:50 (in round 1 LR registry holds the statistics the paper quotes or marks with SMOTE at 1:20 was the exception; after the test- (the TeX macros of all registry values must fit TeX’s weight fix it is +0.0000). Effects are small (LR +0.0000 string pool); every statistic of every family is also written to +0.0015, GB +0.002 to +0.007 at 1:20) and no cell to results/tables/derived_full/, and the correction-versus- has p < 0.05 (smallest p = 0.066). Mean |a| is higher with no-correction p-values agree exactly with rh compare a correction in only 5 of these 12 cells and no difference (results/tables/compare_crosscheck.txt). Unadjusted p < is significant (Table VII, smallest p = 0.11). Section VIII 0.05 cells that do not survive Holm are suggestive only. shows that on data sets with lower discrimination the Calibration slope is heavy-tailed (the registry holds values corrections do worsen LR calibration clearly. from 0.19 to 18.6), so slopes and |b − 1| are reported as Signed calibration-in-the-large (not registered). |a| hides medians with interquartile ranges; all other metrics as a clear effect. LR without correction underestimates risk means. at every prevalence (a = +0.37 to +0.76, Table VII). Hypotheses (registered in proposal.md before the main Every correction lowers a in all 12 LR cells (p ≤ 0.0002): runs). H1: reweighting, ROS and SMOTE give no AU- at natural prevalence a moves toward zero (−0.06 to ROC/AUPRC gain of at least 0.01 over no correction +0.06), and at 1:5, 1:20 and 1:50 it changes sign (−0.35 to (refuted for a cell if the mean paired gain is ≥ 0.01 with −0.89), i.e. the corrected LR models overestimate risk, the p < 0.05; a non-refutation is not evidence of equivalence). direction reported in [1], [7], [9]. Here an underestimate is H2: they raise Brier score and |a| at 1:20 and 1:50. H3: replaced by an overestimate of similar size, so |a| and threshold moving leaves probability metrics identical and the Brier score barely move. For GB, a is positive in trades specificity for sensitivity. H4: with the prior-shift every no-correction cell and lower with a correction at offset, Brier score of the corrected systems is within 0.005 natural prevalence (p ≤ 0.0001); at 1:5–1:50 only 1 of 9 of no correction. cells (SMOTE at 1:5) differs with p < 0.05, and the mean Hardware and runtime. CPU only; each run takes a few |a| of every GB cell at 1:5–1:50 lies between 1.3 and 5.7 seconds (tuned gradient boosting up to about ten). One logits, with or without correction. early sanity run failed (missing output directory) and was Calibration slope. For LR without correction the median rerun; it stays in the registry. slope is above 1 at every prevalence (Fig. 1) (predictions too moderate); the corrections lower the median below V. Results 1 at 1:5–1:50 (at 1:20 from 1.11 to 0.81–0.90, Table I). H1 (corrections do not improve discrimination): no The signed shift is significant in all nine LR cells at 1:5– improvement detected; the test cannot show that none 1:50 (p = 0.0002–0.027) and absent at natural prevalence exists. For LR the AUROC differences to no correction (p > 0.6). The registered distance |b − 1| does not change are at most 0.003 in absolute value over all 12 cells significantly in any LR cell (p ≥ 0.16): at 1:20 its median (Table III; at natural prevalence all LR systems have is larger with a correction (0.27 and 0.28 for ROS and AUROC 0.993, Table II), and at 1:5 reweighting and SMOTE against 0.11) while its mean is smaller or equal ROS are slightly worse in AUROC (p = 0.033 and 0.030), for reweighting, so we draw no conclusion about which is AUPRC (p ≈ 0.05 and 0.041) and Brier score (p = 0.032 closer to 1. GB is over-confident with or without correction and 0.030), unadjusted. For GB, 5 of the 9 AUROC and 6 (median slope 0.31–0.39 at 1:20). of the 9 AUPRC differences at 1:5–1:50 are positive. The H3 (threshold moving): the invariance of probabilities registered refutation criterion (mean paired gain ≥ 0.01 holds by construction; the operating-point part is sup- with p < 0.05) is met by 1 of the 48 cells, GB with ported. “Threshold” and “no correction” use the same ROS at 1:5 (AUPRC +0.011, p = 0.016), which does not fitted model, so their AUROC, AUPRC, Brier score survive the Holm adjustment (adjusted p = 0.39). The and slope are identical by construction in every run gains at 1:20 (AUPRC +0.026 reweight, +0.032 ROS) are (h3_maxabsdiff.csv); this verifies the implementation and not significant (seed sd of AUPRC 0.11–0.17 in Table I). is not an empirical finding. Moving the cut-off to the At 1:50 all three corrections are worse than no correction training prevalence raises sensitivity and lowers specificity TABLE I Primary regime, 1:20 (12 training positives), 10 seeds. AUROC, AUPRC, Brier score and |a| (absolute calibration-in-the-large): mean ± sd; calibration slope b and |b − 1|: median [IQR]. Threshold moving has the probabilities of no correction and is omitted. System AUROC AUPRC Brier slope b |b − 1| |a| LR + no correction 0.991 ± 0.005 0.940 ± 0.030 0.008 ± 0.003 1.11 [0.99, 1.24] 0.11 [0.04, 0.24] 0.718 ± 0.339 LR + reweight 0.989 ± 0.007 0.933 ± 0.034 0.009 ± 0.003 0.90 [0.77, 1.02] 0.21 [0.07, 0.27] 0.836 ± 0.531 LR + ROS 0.989 ± 0.009 0.932 ± 0.034 0.009 ± 0.004 0.81 [0.68, 0.91] 0.27 [0.10, 0.35] 0.684 ± 0.529 LR + SMOTE 0.990 ± 0.007 0.938 ± 0.032 0.008 ± 0.003 0.82 [0.71, 0.91] 0.28 [0.16, 0.35] 0.580 ± 0.408 GB + no correction 0.909 ± 0.057 0.729 ± 0.173 0.021 ± 0.009 0.32 [0.25, 0.43] 0.68 [0.57, 0.75] 5.091 ± 3.362 GB + reweight 0.890 ± 0.087 0.756 ± 0.156 0.023 ± 0.013 0.39 [0.31, 0.51] 0.61 [0.49, 0.69] 3.793 ± 2.805 GB + ROS 0.914 ± 0.050 0.761 ± 0.108 0.024 ± 0.013 0.36 [0.29, 0.47] 0.64 [0.53, 0.71] 4.633 ± 2.897 GB + SMOTE 0.911 ± 0.048 0.731 ± 0.156 0.028 ± 0.014 0.31 [0.25, 0.43] 0.69 [0.57, 0.75] 5.239 ± 1.436 TABLE II AUROC, AUPRC and Brier score across prevalences (nat. = natural), mean of 10 seeds; threshold moving equals no correction here. AUROC AUPRC Brier System nat. 1:5 1:20 1:50 nat. 1:5 1:20 1:50 nat. 1:5 1:20 1:50 LR + no correction 0.993 0.993 0.991 0.989 0.992 0.980 0.940 0.910 0.024 0.016 0.008 0.005 LR + reweight 0.993 0.991 0.989 0.988 0.992 0.976 0.933 0.899 0.025 0.019 0.009 0.006 LR + ROS 0.993 0.990 0.989 0.988 0.992 0.974 0.932 0.895 0.025 0.020 0.009 0.006 LR + SMOTE 0.993 0.991 0.990 0.990 0.992 0.976 0.938 0.910 0.025 0.018 0.008 0.005 GB + no correction 0.986 0.977 0.909 0.878 0.984 0.941 0.729 0.638 0.042 0.040 0.021 0.013 GB + reweight 0.986 0.977 0.890 0.849 0.983 0.943 0.756 0.570 0.041 0.035 0.023 0.015 GB + ROS 0.986 0.981 0.914 0.834 0.984 0.951 0.761 0.562 0.041 0.036 0.024 0.015 GB + SMOTE 0.987 0.981 0.911 0.850 0.985 0.950 0.731 0.553 0.039 0.032 0.028 0.016 TABLE III Paired difference to no correction, same learner (positive ∆Brier = worse). ∗ : unadjusted paired p < 0.05, 10 seeds; † : Holm-adjusted p < 0.05 (family: one metric over all 24 learner × correction × task cells). 1:5 1:20 1:50 Correction ∆AUROC ∆AUPRC ∆Brier ∆AUROC ∆AUPRC ∆Brier ∆AUROC ∆AUPRC ∆Brier ∗ ∗ ∗ LR + reweight −0.002 −0.004 +0.003 −0.002 −0.007 +0.001 −0.001 −0.011 +0.001 LR + ROS −0.003∗ −0.006∗ +0.004∗ −0.002 −0.008 +0.001 −0.001 −0.015 +0.001 LR + SMOTE −0.001 −0.004 +0.002 −0.001 −0.002 +0.000 +0.001 0.000 +0.000 GB + reweight +0.000 +0.002 −0.004 −0.019 +0.026 +0.002 −0.029 −0.068 +0.002 GB + ROS +0.004∗ +0.011∗ −0.003 +0.005 +0.032 +0.003 −0.044 −0.076 +0.002 GB + SMOTE +0.004 +0.010 −0.007 +0.002 +0.002 +0.007 −0.028 −0.085 +0.003 calibration slope (median, IQR) from 0.863 to 0.938; at natural prevalence the balanced- LR GB accuracy change is within noise (0.963 to 0.965, p = 0.46). For GB the gains are smaller and at 1:20 and 1:50 not 100 significant (p = 0.09 at 1:20 and 0.08 at 1:50). 6 × 10−1 no correction Operating point of the corrections (not registered). reweight 4 × 10−1 ROS Threshold moving is not the only strategy that moves the 3 × 10−1 SMOTE LR operating point. At the 0.5 cut-off reweighting, ROS and SMOTE raise LR sensitivity in all 12 cells (p ≤ 0.012; nat. 1:5 1:20 1:50 nat. 1:5 1:20 1:50 0.727 to 0.812–0.814 at 1:50) and LR balanced accuracy at 1:5, 1:20 and 1:50 (p = 0.0003–0.032; 0.863 to 0.905– Fig. 1. Calibration slope (log axis), median and IQR over 10 seeds 0.906 at 1:50), with a specificity loss that is significant in by prevalence; dashed line = 1. 7 of the 12 cells. Threshold moving raises both further: balanced accuracy is 0.947 against 0.927–0.928 for the corrections at 1:20 and 0.938 against 0.905–0.906 at 1:50 (Table IV). For LR sensitivity rises from 0.727 to 0.909 (threshold versus each correction p ≤ 0.007 at 1:20 and at 1:50 (specificity 1.000 to 0.967) and balanced accuracy p ≤ 0.008 at 1:50, p = 0.014–0.077 at 1:5, no difference at natural prevalence), with lower specificity than the at 1:20, where the raw Brier score is 0.028 against 0.021 corrections, without changing a probability. None of the for no correction, which the offset brings to 0.026). The threshold-versus-correction balanced-accuracy differences offset does not move Brier score consistently toward no survives the Holm adjustment. This agrees with the signed correction: the gap shrinks in magnitude in 11 of 24 cells a: the corrections act on LR mainly as an upward shift (2 of 12 for LR, 9 of 12 for GB). The offset also raises of risk. Section VII asks whether this advantage is more mean |a| in all 24 of 24 cells (with unadjusted p < 0.05 than the difference in cut-off. For GB the corrections do in 10): LR at 1:20 goes from |a| = 0.84 (reweight), 0.68 not help: balanced accuracy improves with p < 0.05 only (ROS) and 0.58 (SMOTE) to 2.21, 2.43 and 2.62, against for SMOTE at 1:5 (not after Holm), and at 1:20 and 1:50 0.72 for no correction (Table VII). The arithmetic is that all three corrections have lower mean balanced accuracy π the offset shifts every logit by log 1−π − log 1−π πeff eff ≈ −3 at than no correction (differences at most −0.002, p > 0.2). 1:20 and therefore raises a by about 3; the raw corrected Multiplicity. Table V gives, for each metric, the number LR models overestimated risk by less than one logit (a = of correction-versus-no-correction tests with unadjusted −0.42 to −0.82 at 1:20), so the offset overshoots into a p < 0.05 and with Holm-adjusted p < 0.05. Of the claims strong underestimate. We read H4 as refuted in spirit on in the abstract of round 1, the following survive Holm: this data set (no repair, higher |a|) although the registered the LR signed-intercept shift (15 of 24 cells for the family, threshold is formally met in 23 cells. The next paragraph including all LR cells at 1:5, 1:20 and 1:50 and at natural and Section VIII examine when the offset works. prevalence) and the LR sensitivity increase (7 of 12 LR Simulation: when does the offset work? (added in cells; all at 1:5 and 1:50 and the reweighting cell at natural round 1). Section IV describes the controlled simulation prevalence). The LR balanced-accuracy gain at 1:5, 1:20, (correctly specified logistic model, prevalence 0.05, n ∈ 1:50 survives in 3 of 12 cells (the 1:50 cells). Do not survive: {250, 1000, 4000} training rows with about a dozen, fifty the 1:5 LR losses in AUROC, AUPRC and Brier score and two hundred positives, signal strength s ∈ {1, 2, 4, 8}, (smallest adjusted p 0.72), the GB ROS 1:5 AUPRC gain C ∈ {0.01, 1, 100}, 20 seeds per cell). Table VIII gives (adjusted p = 0.39), and the specificity losses (0 of 24 the signed intercept of ROS without and with the offset; cells in the family). Across the 24 cells of each family, no reweighting and SMOTE behave alike (they are included AUROC, AUPRC, Brier or |a| difference survives (0, 0, 0 in the averages below). Without correction the intercept is and 0 cells). close to zero everywhere (largest cell mean |a| 0.36). Every Where the methods fail. GB at 1:50 is the clearest correction without the offset has a cell-mean intercept failure: with 5 training positives, GB without correction between −3.3 and −2.0 logits (overestimation), near the reaches AUROC 0.878 and with any correction 0.834– analytic shift of about −3. With the offset the intercept is 0.850 (Table II), its AUPRC is 0.638 without correction closer to zero than without it in 36 of 36 cells and within against 0.910 for LR, and its sensitivity at 0.5 is 0.573– ±0.25 in 21 cells, so in a correctly specified model the offset 0.616 (Table IV). Resampling five positives may make repairs the intercept in most cells. It overshoots (a > 0.25, GB overfit them; Section VII tests whether regularised an underestimate) in 13 cells and undershoots in 2. The boosting changes this. On some seeds the three corrections overshoot grows with the signal strength (mean offset- give identical GB test metrics at 1:50, and the largest corrected a over the corrections and cells: −0.01 at s = 1, slopes in the registry come from this regime. 0.04 at s = 2, 0.16 at s = 4 and 0.47 at s = 8), with a stronger penalty (0.43, 0.14 and −0.07 for C = 0.01, 1, 100) VI. Ablations and Analysis and with fewer training cases (0.22, 0.17 and 0.10 for Prior-shift offset (H4). We add the logit offset of Eq. (1) n = 250, 1000, 4000). The mechanism visible in the logs to reweighting, ROS and SMOTE (πeff = 0.5 in all three) is that in near-separable or heavily penalised fits the for both learners and all four tasks, with π the realised corrected model absorbs only part of the analytic shift: the training prevalence. AUROC changes in one cell only (GB fraction of the offset by which the raw intercept actually with ROS at 1:5, where clipping ties saturated predictions; moved averages 1.01 at s = 1 and 0.83 at s = 8 (0.87 largest per-run change 0.0001). Table VI gives the mean at C = 0.01), so adding the full offset overshoots. The Brier score without (raw) and with the offset next to the largest overshoot is 0.95 logits. This reproduces the sign no-correction value of the same learner, so the Brier gap of the breast-cancer failure (near-separable, few positives) to no correction is the difference to that row; Table VII but not its size: on breast cancer the offset moves |a| from the calibration-in-the-large. below one logit to above two (Table VII), more than in H4 as registered (corrected Brier within 0.005 of no any simulated cell. The simulation uses 10 independent correction) holds in 23 of 24 cells; the exception is GB features and a correctly specified model; breast cancer with SMOTE at 1:5, where the Brier score with the offset has 30 correlated features and 5 to 12 positives, which we is 0.032 against 0.040 for no correction (better than no did not simulate, so the full breast-cancer failure is not correction, as is the raw model at 0.032). The criterion explained by this simulation. is weak: the raw gaps are already within 0.005 in 22 of SMOTE target ratio. Fig. 2 varies the target ratio r 24 cells (the exceptions are GB with SMOTE at 1:5 and at 1:20 (r = 1 is the main-group SMOTE rows). For LR, TABLE IV Operating point at each system’s cut-off (0.5; training prevalence for threshold moving), mean of 10 seeds. ∗ : unadjusted paired p < 0.05 against no correction, same learner; † : Holm-adjusted p < 0.05. Sensitivity Specificity Balanced accuracy System nat. 1:5 1:20 1:50 nat. 1:5 1:20 1:50 nat. 1:5 1:20 1:50 LR + no correction 0.939 0.887 0.805 0.727 0.988 0.997 1.000 1.000 0.963 0.942 0.902 0.863 LR + reweight 0.955†∗ 0.928†∗ 0.861∗ 0.816†∗ 0.980∗ 0.985∗ 0.993∗ 0.997 0.968∗ 0.957∗ 0.927∗ 0.906†∗ LR + ROS 0.950∗ 0.925†∗ 0.859∗ 0.812†∗ 0.978∗ 0.984∗ 0.995 0.997 0.964 0.955∗ 0.927∗ 0.905†∗ LR + SMOTE 0.950∗ 0.920†∗ 0.858∗ 0.814†∗ 0.980∗ 0.987∗ 0.998 0.997 0.965 0.954∗ 0.928∗ 0.906†∗ LR + threshold 0.956†∗ 0.952†∗ 0.922†∗ 0.909†∗ 0.974†∗ 0.975†∗ 0.972†∗ 0.967†∗ 0.965 0.963†∗ 0.947†∗ 0.938†∗ GB + no correction 0.912 0.839 0.727 0.616 0.969 0.980 0.990 0.993 0.941 0.910 0.858 0.805 GB + reweight 0.922 0.858 0.688 0.614 0.963 0.979 0.990 0.992 0.942 0.918 0.839 0.803 GB + ROS 0.920 0.852 0.672 0.573 0.967 0.980 0.989 0.992 0.944 0.916 0.830 0.783 GB + SMOTE 0.919 0.875∗ 0.716 0.572 0.964 0.980 0.981 0.991 0.942 0.928∗ 0.848 0.781 GB + threshold 0.923†∗ 0.856†∗ 0.762 0.652 0.964 0.974∗ 0.986 0.991 0.944∗ 0.915∗ 0.874 0.821 TABLE V VII. Controls and Comparisons Number of cells (of 24 per family and data set) with unadjusted p < 0.05 and with Holm-adjusted p < 0.05, correction versus no This section reports the controls and comparisons added correction, same learner. in round 1 (protocols in Section IV); all are on breast cancer, four tasks, 10 seeds, with every system receiving Breast cancer (4 tasks) the same budget. Counts are over the 24 cells (2 learners × Pima (4 tasks) Metric tests unadj. Holm tests unadj. 3Holm corrections × 4 tasks) unless stated; unadjusted p < 0.05 AUROC 24 3 0 24 5 is 0written “significant” and Holm-adjusted p < 0.05 is AUPRC 24 3 0 24 4 0 separately. stated Brier 24 2 0 24 20 14 threshold moving’s advantage more than a different Is signed a 24 16 15 24 22 22 |a| 24 0 0 24 20 cut-off? 15 Table IX compares threshold moving, each cor- slope b 24 11 4 24 14 rection 9 at its usual cut-off (0.5; column “usual”) and each |b − 1| 24 4 0 24 12 correction at the cut-off that matches threshold moving’s 5 Sensitivity 24 13 7 24 22 22 specificity (a diagnostic that uses test labels). For LR the Specificity 24 7 0 24 22 21 advantage of threshold moving disappears: at the matched Balanced accuracy 24 11 3 24 21 21 cut-off the corrected model’s balanced accuracy differs from threshold moving’s by between −0.010 and +0.002 in all 12 LR cells (threshold minus matched; at 1:20 −0.005 LR + SMOTE to −0.001, at 1:50 −0.010 to −0.008), and 0 of the 12 0.03 GB + SMOTE differences is significant, whereas at the usual cut-off the corrections trailed threshold moving by 0.019 to 0.020 at AUPRC 0.8 Brier0.02 1:20 and 0.032 to 0.033 at 1:50. Moving the corrected LR model to the matched cut-off raises its balanced accuracy 0.01 0.6 in 12 of 12 cells (significant in 6, none after Holm). So for LR the earlier finding that threshold moving beats the 0.5 1.0 0.5 1.0 corrections on balanced accuracy is explained by the cut- SMOTE target ratio SMOTE target ratio off: a 1:1 correction roughly moves the cut-off to π, and a cut-off at matched specificity gives the corrected model Fig. 2. SMOTE target ratio at 1:20: Brier score and AUPRC (mean, the same operating point. For GB the picture is not clean: normal-approximation 95% interval over 10 seeds); dotted lines are threshold moving is ahead of the corrected models at 1:20 the no-correction means. by +0.033 to +0.053 (all three p ≥ 0.25) but behind at 1:5 (−0.019 to −0.010, significant in all three, none after Holm); with 10 seeds the GB differences are too noisy to Brier score and AUPRC are flat in r and close to the separate. no-correction level. For GB both are noisy: Brier score is Equal-budget tuning. Each system’s hyperparameters lowest at an intermediate ratio (0.023 at r = 0.50) and were chosen by the same inner cross-validation over the highest at r = 1 (0.028), and AUPRC dips at r = 0.75 same grid (Section IV). Tuning matters for GB: tuned (0.666), which looks like seed noise given the seed sd of GB without correction against the fixed GB has AUROC 0.11–0.17 in Table I. We claim no trend; the sweep covers 0.978 against 0.909 at 1:20 and 0.955 against 0.878 at 1:50 one task and one correction. (paired p = 0.003 and 0.009), Brier score lower in 4 of 4 TABLE VI Prior-shift ablation, breast cancer: mean Brier score over 10 seeds, raw versus with logit offset; the no-correction row of the same learner is the reference for the Brier gap discussed in the text. nat. 1:5 1:20 1:50 System raw +offset raw +offset raw +offset raw +offset LR + no correction 0.024 0.016 0.008 0.005 LR + reweight 0.025 0.025 0.019 0.018 0.009 0.010 0.006 0.006 LR + ROS 0.025 0.025 0.020 0.018 0.009 0.009 0.006 0.006 LR + SMOTE 0.025 0.025 0.018 0.018 0.008 0.009 0.005 0.006 GB + no correction 0.042 0.040 0.021 0.013 GB + reweight 0.041 0.041 0.035 0.035 0.023 0.022 0.015 0.014 GB + ROS 0.041 0.042 0.036 0.035 0.024 0.024 0.015 0.014 GB + SMOTE 0.039 0.040 0.032 0.032 0.028 0.026 0.016 0.016 TABLE VII Calibration-in-the-large, breast cancer, mean of 10 seeds: signed a (> 0: risk underestimated), |a|, and |a|off with the prior-shift offset. ∗ : a differs from no correction, same learner, unadjusted paired p < 0.05; † : Holm-adjusted p < 0.05. nat. 1:5 1:20 1:50 System a |a| |a|off a |a| |a|off a |a| |a|off a |a| |a|off LR + no correction +0.33 0.41 – +0.37 0.44 – +0.64 0.72 – +0.76 0.90 – LR + reweight −0.06†∗ 0.35 0.51 −0.66†∗ 0.66 0.95 −0.82†∗ 0.84 2.21 −0.89†∗ 1.19 3.02 LR + ROS −0.03†∗ 0.43 0.56 −0.64†∗ 0.64 0.97 −0.60†∗ 0.68 2.43 −0.61†∗ 1.19 3.29 LR + SMOTE +0.06†∗ 0.38 0.62 −0.35†∗ 0.42 1.26 −0.42†∗ 0.58 2.62 −0.43†∗ 1.11 3.48 GB + no correction +0.84 1.21 – +1.92 2.25 – +1.25 5.09 – +2.57 5.72 – GB + reweight +0.35†∗ 1.01 1.21 +0.97 2.71 3.49 +1.99 3.79 6.07 +1.17 4.56 6.50 GB + ROS +0.52†∗ 1.04 1.35 +1.59 2.24 3.21 +1.08 4.63 6.22 +1.15 4.54 6.42 GB + SMOTE +0.23†∗ 0.97 1.17 +0.41∗ 1.31 2.03 +0.12 5.24 5.24 +0.19 5.44 6.58 tasks, and mean |a| 1.62 against 5.09 at 1:20; the large |a| cells, one of which survives Holm, so the statement that and the over-confident slope of GB in the main groups are corrections give no gain in discrimination does not hold therefore largely a property of the untuned configuration for tuned GB at 1:5 and 1:20. (Tables X, XI). Tuned LR is close to LR with C = 1 in AUROC (differences at most 0.002 in absolute value over Recalibration on held-out training folds. Platt scaling the four tasks), with a larger |a| at 1:20 and 1:50 (+0.60 of the uncorrected model lowers GB’s |a| in 4 of 4 tasks and +1.24). (all four after Holm; at 1:20 0.56 against 5.09) and, for LR, leaves AUROC unchanged (the map is monotone; the Against tuned no correction the corrections give, over largest AUROC difference over the four tasks is 0.000) the 24 cells: AUROC higher in 8 cells and significantly and Brier score within noise. Applying Platt scaling to different in 4 (all lower, LR, none after Holm); AUPRC a corrected model removes most of the signed shift (LR significantly higher in 4 cells, all GB (reweighting, ROS with ROS at 1:20: a = −0.06 against −0.60 raw), but and SMOTE at 1:5 and ROS at 1:20; gains of +0.005 to the corrected-and-recalibrated models are not better than +0.014), and significantly lower in 5 LR cells; the one cell the recalibrated uncorrected model: Brier score is higher that meets the registered H1 refutation rule and survives with a correction in 12 of 12 LR cells (significant in 2), Holm is tuned GB with ROS at 1:20 (AUPRC +0.014, AUROC is lower in 11 of 12 (significant in 2), and |a| is p = 0.001, adjusted p = 0.03). At 1:50 tuned GB with ROS significantly lower with a correction in 2 LR cells and or SMOTE is worse than tuned no correction in AUROC significantly higher in none. Against unrecalibrated no (−0.054 and −0.040, not significant). The signed intercept correction, corrected-and-Platt LR models have a higher is lower with a correction in 24 of 24 cells (significant in sensitivity in 11 of 12 cells (6 significant, 2 after Holm), 18, 10 after Holm) and |a| differs significantly in none; i.e. the operating-point effect survives recalibration at the sensitivity at 0.5 is higher in 23 cells (17 significant, 6 after 0.5 cut-off. Isotonic recalibration with 5 to 12 positives Holm) and balanced accuracy in 22 cells (11 significant, 5 costs ranking: LR AUROC at 1:20 is 0.957 against 0.991 after Holm). With tuned learners the main picture for LR (lower in all 4 of 4 tasks, p ≤ 0.007), and |a| at 1:50 is unchanged (a shifted intercept and a higher operating is larger than without recalibration for LR (4.28 against point, no discrimination gain), while for GB small AUPRC 0.90). Answer to the repair question: after cross-fitted gains from the corrections are detected in four of 12 Platt scaling the corrected models can be brought back to TABLE VIII Simulation, mean signed calibration-in-the-large a over 20 seeds: no correction, ROS raw, ROS with the offset; n training size, s signal strength, C LR penalty (a < 0: risk overestimated). C = 0.01 C=1 C = 100 n s none ROS raw ROS off. none ROS raw ROS off. none ROS raw ROS off. 250 1 +0.10 −2.70 +0.35 +0.07 −3.16 −0.12 +0.06 −3.27 −0.23 250 2 +0.06 −2.53 +0.46 +0.02 −3.03 −0.04 −0.01 −3.31 −0.32 250 4 +0.01 −2.39 +0.56 −0.02 −2.68 +0.27 −0.20 −3.43 −0.48 250 8 +0.02 −2.29 +0.67 +0.02 −2.06 +0.90 −0.36 −2.64 +0.32 1000 1 +0.02 −2.88 +0.09 +0.01 −3.00 −0.02 +0.01 −3.00 −0.03 1000 2 +0.05 −2.67 +0.32 +0.04 −3.05 −0.07 +0.03 −3.07 −0.08 1000 4 +0.05 −2.38 +0.62 +0.04 −2.99 +0.01 +0.04 −3.09 −0.10 1000 8 +0.04 −2.20 +0.78 +0.02 −2.63 +0.36 −0.02 −3.16 −0.17 4000 1 +0.01 −2.93 +0.02 +0.01 −2.96 −0.01 +0.01 −2.96 −0.01 4000 2 +0.01 −2.82 +0.12 +0.01 −2.96 −0.01 +0.01 −2.96 −0.02 4000 4 −0.01 −2.54 +0.40 −0.02 −2.98 −0.04 −0.02 −2.99 −0.05 4000 8 +0.00 −2.23 +0.72 −0.01 −2.92 +0.03 −0.02 −3.06 −0.11 TABLE IX Balanced accuracy of threshold moving (thr.), of the corrected model at the usual cut-off (usual) and at the cut-off whose specificity matches threshold moving (matched; uses test labels), mean of 10 seeds. ∗ : threshold moving differs from the matched corrected model, unadjusted p < 0.05. nat. 1:20 1:50 Learner Correction thr. usual matched thr. usual matched thr. usual matched LR reweight 0.965 0.968 0.968 0.947 0.927 0.948 0.938 0.906 0.946 LR ROS 0.965 0.964 0.970 0.947 0.927 0.948 0.938 0.905 0.947 LR SMOTE 0.965 0.965 0.969 0.947 0.928 0.952 0.938 0.906 0.948 GB reweight 0.944 0.942 0.947 0.874 0.839 0.841 0.821 0.803 0.813 GB ROS 0.944 0.944 0.947 0.874 0.830 0.823 0.821 0.783 0.810 GB SMOTE 0.944 0.942 0.946 0.874 0.848 0.822 0.821 0.781 0.816 roughly the calibration of no correction, but not past it, the main systems; the paired statistics follow the families and the uncorrected model recalibrated in the same way of Section IV (Pima: 24 cells per metric; mammography: is at least as good on Brier score and AUROC. 6 cells per metric, Holm within each data set). Normalised loss weight (LR). With the total loss weight Discrimination. On Pima the corrections do not improve fixed at the size of the original training set, ROS and discrimination: LR AUROC differences range from −0.040 SMOTE differ little from the unnormalised versions in dis- to +0.001 (lower in 4 cells with p < 0.05, none after Holm) crimination or operating point (largest absolute difference and GB differences from −0.018 to +0.005; the registered over the 8 cells: AUROC 0.001, balanced accuracy 0.003), H1 rule is met by 1 of 48 cells (GB with reweighting at and the shift of the signed intercept is larger, not smaller: 1:50, AUPRC +0.030, p = 0.041, adjusted p = 0.87). On at 1:20 a = −0.83 and −0.67 against −0.60 and −0.42 mammography the corrections do raise AUROC: LR by (lower in all 8 of 8 cells; the calibration slope is higher in +0.005 to +0.006 and GB by +0.013 to +0.014 (all six p ≤ 8 of 8). Against no correction the normalised versions lower 0.002, adjusted p ≤ 0.004), and the GB gain exceeds the a in all 8 of 8 cells (all after Holm) and raise sensitivity in registered margin of 0.01; AUPRC, by contrast, falls for all 8 of 8. The difference in effective regularisation between LR (−0.069 to −0.076) and rises, not significantly, for GB. reweighting and resampling is therefore not what produces The claim that corrections give no gain in discrimination the intercept shift or the operating-point change. is therefore not general: it holds on breast cancer and VIII. Clinical Data Sets with Lower Discrimination Pima, not on mammography with an event rate of about The breast-cancer data are close to separable (LR two per cent. AUROC 0.993 at natural prevalence), so two further Calibration. Here the corrections clearly distort LR risk. clinical tabular data sets with lower discrimination were On Pima every correction lowers the signed intercept in all added (Section IV): Pima Indians diabetes at the four 12 LR cells (all 12 after Holm), by −0.62 to −4.50 logits, prevalences (LR AUROC 0.823 at natural prevalence and raises |a| in all 12 (by +0.41 to +4.16; all after Holm) and 0.795 at 1:20) and mammography at its natural event rate raises Brier score in all 12 (+0.007 to +0.111; 10 after of about two per cent (LR AUROC 0.907). Table XII gives Holm); at 1:20 LR Brier score is 0.045 without correction TABLE X Controls at 1:20: Brier score and signed a of each system with the fixed hyperparameters (default), with equal-budget tuning, and with Platt or isotonic recalibration fitted on held-out training folds; mean of 10 seeds. Brier signed a System default tuned Platt isotonic default tuned Platt isotonic LR + no correction 0.008 0.008 0.009 0.008 +0.64 +1.31 +0.18 +0.31 LR + reweight 0.009 0.008 0.009 0.009 −0.82 +0.31 +0.05 +0.24 LR + ROS 0.009 0.009 0.010 0.009 −0.60 +0.35 −0.06 +0.20 LR + SMOTE 0.008 0.008 0.009 0.009 −0.42 +0.78 −0.03 +0.14 GB + no correction 0.021 0.014 0.020 0.021 +1.25 +1.17 +0.03 −0.12 GB + reweight 0.023 0.018 0.019 0.021 +1.99 +0.16 +0.31 +0.19 GB + ROS 0.024 0.016 0.020 0.020 +1.08 −0.40 +0.22 +0.02 GB + SMOTE 0.028 0.018 0.022 0.024 +0.12 −0.45 +0.07 −1.14 TABLE XI As Table X at 1:50 (5 training positives). Brier signed a System default tuned Platt isotonic default tuned Platt isotonic LR + no correction 0.005 0.006 0.005 0.005 +0.76 +1.54 −0.21 +1.25 LR + reweight 0.006 0.006 0.007 0.007 −0.89 −0.19 −0.53 +0.97 LR + ROS 0.006 0.006 0.007 0.008 −0.61 +0.25 −0.68 +0.85 LR + SMOTE 0.005 0.006 0.006 0.006 −0.43 +0.41 −0.61 −0.04 GB + no correction 0.013 0.008 0.013 0.014 +2.57 +2.71 −0.80 −1.43 GB + reweight 0.015 0.007 0.014 0.014 +1.17 +2.01 −0.59 −0.86 GB + ROS 0.015 0.011 0.014 0.014 +1.15 +0.16 −0.65 +0.30 GB + SMOTE 0.016 0.011 0.015 0.014 +0.19 −0.49 −0.70 +0.32 TABLE XII Pima and mammography: AUROC, Brier score, signed a and balanced accuracy (at each system’s cut-off), mean of 10 seeds. ∗ / † : unadjusted / Holm-adjusted paired p < 0.05 against no correction, same learner (not shown for AUROC). Pima, natural Pima, 1:20 Mammography, natural System AUROC Brier a Bal. acc. AUROC Brier a Bal. acc. AUROC Brier a Bal. acc. LR + no correction 0.823 0.163 +0.06 0.709 0.795 0.045 +0.01 0.520 0.907 0.014 +0.03 0.701 LR + reweight 0.823 0.170∗ −0.56†∗ 0.738†∗ 0.791 0.153†∗ −3.11†∗ 0.703†∗ 0.912 0.080†∗ −3.61†∗ 0.864†∗ LR + ROS 0.822 0.172†∗ −0.58†∗ 0.734†∗ 0.790 0.156†∗ −3.14†∗ 0.706†∗ 0.912 0.080†∗ −3.62†∗ 0.863†∗ LR + SMOTE 0.823 0.171∗ −0.58†∗ 0.736†∗ 0.781 0.156†∗ −3.23†∗ 0.698†∗ 0.913 0.078†∗ −3.63†∗ 0.865†∗ LR + threshold 0.823 – – 0.741 0.795 – – 0.712 0.907 – – 0.874 GB + no correction 0.823 0.166 +0.04 0.719 0.734 0.054 +0.83 0.528 0.934 0.012 +0.22 0.774 GB + reweight 0.822 0.171∗ −0.39†∗ 0.738†∗ 0.716 0.068∗ −0.79†∗ 0.557†∗ 0.948 0.029†∗ −2.73†∗ 0.897†∗ GB + ROS 0.820 0.171 −0.33†∗ 0.735 0.716 0.068∗ −0.79†∗ 0.562†∗ 0.948 0.029†∗ −2.74†∗ 0.897†∗ GB + SMOTE 0.821 0.172∗ −0.38†∗ 0.739†∗ 0.720 0.092†∗ −1.82†∗ 0.582†∗ 0.947 0.031†∗ −2.75†∗ 0.898†∗ GB + threshold 0.823 – – 0.752 0.734 – – 0.602 0.934 – – 0.883 and 0.156 with ROS, with a = −3.14. On mammography absorbed when the classes are nearly separable. the Brier score of LR rises from 0.014 to 0.080 and a falls from +0.03 to −3.62 (adjusted p ≤ 5.6×10−15 for the three Operating point. The corrections raise LR sensitivity in corrections’ a and ≤ 7.4 × 10−11 for their Brier score). For all 12 Pima cells (by +0.16 to +0.57; all after Holm) GB the Brier score is higher with a correction in 10 of 12 and balanced accuracy in all 12 (+0.024 to +0.186), Pima cells (4 after Holm) and on mammography (+0.017 with a loss of specificity. Threshold moving reaches the to +0.019). H2 is thus supported for LR on both data sets, same or a higher balanced accuracy without changing in contrast to breast cancer where the absolute intercept the probabilities: for LR on Pima it is higher than each and Brier score barely moved. Why breast cancer differs is correction by +0.002 to +0.014 at natural prevalence, 1:5 not established by these runs; Section VI gives a simulation and 1:20 (not significant after Holm; unadjusted p ≥ 0.01) in which the intercept shift of a correction is only partly and by +0.039 to +0.046 at 1:50 (p ≤ 0.00044); on mammography it is higher for LR by +0.009 to +0.011 and lower for GB by −0.015 to −0.014. The specificity- registered size. The registered H4 threshold turned out to matched comparison of Section VII was run on breast be nearly vacuous, which we report rather than change. cancer only. Controls. The specificity-matched cut-off uses test labels Prior-shift offset. Table XIII and XIV give the offset and is a diagnostic. Tuning uses one small grid with ablation on Pima and mammography. For LR the offset a 3-fold inner cross-validation on log-loss, which with 5 works here: the Brier gap to no correction shrinks in all positives is itself noisy; the recalibration maps are fitted 12 of 12 Pima cells (within 0.005 in 8 of 12, against 0 on out-of-fold risks of models refitted on training parts, for the raw corrections), |a| is not raised by the offset in so they are applied to a model that was not the one that any of the 12 cells (|a|off 0.27 against 3.14 raw at 1:20, produced those risks. The loss-weight control covers LR close to 0.21 for no correction), and on mammography only. Tuning, recalibration, the loss-weight control and the Brier gap falls from +0.067 to +0.001 with |a| from the matched cut-off were run on breast cancer only; Pima 3.62 to 0.15. The offset therefore restores the calibration and mammography ran the main systems and the offset. of LR where classes overlap, as in the simulation, and Simulation and mechanisms. The simulation has 10 fails on near-separable breast cancer. For GB the offset independent features, a correctly specified model and one helps less: the Brier gap shrinks in 10 of 12 Pima cells prevalence; it reproduces the sign of the offset failure but |a| rises in 8 of 12, and on mammography the GB |a| on breast cancer (overshoot with strong signal, strong is 1.00 with the offset against 2.74 raw. These data sets penalty and few positives) but not its size, and it was differ from breast cancer in more than separability (size, not designed to explain the GB behaviour. Breast cancer number of features, event rate), so they are consistent with has 30 correlated features and 5 to 12 positives, which the simulation-based explanation but do not isolate it. we did not simulate. The Pima and mammography re- sults are consistent with the simulation but differ from IX. Limitations breast cancer in size, features and event rate as well as separability. Scale and data. Three public data sets (breast cancer Implementation. SMOTE, ROS and the offset are reim- Wisconsin, 569 patients, LR AUROC 0.993, so a null plemented and were checked only through the run logs on discrimination is nearly guaranteed there; Pima, 768 (e.g. training-set sizes), not against imbalanced-learn. One rows; mammography, 11183 rows), 10 seeds of one 70/30 SMOTE variant (k = 5) was used; undersampling and split protocol, no external validation. Breast cancer is cost-sensitive learning are out of scope. Calibration curves image-derived tabular data, not EHR data or a clinical and external validation are not provided. time series; Pima and mammography are tabular as well. At the artificial prevalences the imbalance is created by X. Conclusion subsampling positives and reweighting the test set, which On breast cancer with LR, the corrections did not give is not a genuinely imbalanced cohort; only mammography a detected gain in AUROC or AUPRC at any prevalence, is imbalanced by nature and it is run at its natural and they shifted predicted risk upward: the signed inter- prevalence only. Pima zeros are kept as in the source, and cept fell in every cell and went from underestimation to the OpenML copies are fetched at run time (the cached overestimation at 1:5–1:50, which survives Holm adjust- files are not in the repository). ment, while the absolute intercept and the Brier score Few positives. At 1:20 and 1:50 the models are trained barely moved. These LR findings were reported before [1]. on 12 and 5 malignant cases, and we evaluate on all held- The added controls narrow several statements of the first out patients with positives down-weighted to the realised version: the isolated p < 0.05 losses and the GB ROS 1:5 training prevalence. Brier score, AUPRC, calibration slope gain do not survive Holm; tuned GB shows small AUPRC and intercept are then dominated by the 107 negatives and gains from the corrections in 4 of 12 cells and mammogra- are noisy; the large |a| of GB in the main groups is largely phy shows AUROC gains, so “no gain in discrimination” a property of the untuned configuration (Section VII), holds on breast cancer and Pima but not in general; with a few saturated errors still possible. The weighted on Pima and mammography the corrections degrade LR evaluation is not equivalent to a genuine 1:50 cohort. calibration clearly; threshold moving’s balanced-accuracy Statistics. Tests are paired t-tests over 10 seeds that advantage over corrected LR is explained by the cut-off (no share one data set; Holm adjustment is applied within significant difference at matched specificity); Platt scaling the families defined in Section IV and not across families, repairs corrected models only back to about the level of and the several hundred tests in results/tables and the no correction; and the prior-shift offset, which fails on registry are otherwise unadjusted. The signed-intercept, near-separable breast cancer, restores LR calibration on signed-slope, operating-point and all analyses added in Pima and mammography and in simulation when classes this revision were not registered and were added after overlap. With three data sets and 10 seeds the advice seeing the data. H1 is a refutation rule, not an equivalence stays modest: report the signed calibration intercept with test: with 10 seeds and GB AUPRC seed sd of 0.11 or more discrimination, use the threshold or a recalibrated model a non-significant difference does not exclude a gain of the before resampling when only the operating point matters, TABLE XIII Prior-shift ablation, Pima and mammography: mean Brier score over 10 seeds, raw versus with logit offset. nat. 1:20 nat. System raw +offset raw +offset raw +offset LR + no correction 0.163 0.045 0.014 LR + reweight 0.170 0.163 0.153 0.050 0.080 0.015 LR + ROS 0.172 0.163 0.156 0.050 0.080 0.015 LR + SMOTE 0.171 0.163 0.156 0.052 0.078 0.015 GB + no correction 0.166 0.054 0.012 GB + reweight 0.171 0.168 0.068 0.048 0.029 0.013 GB + ROS 0.171 0.170 0.068 0.048 0.029 0.013 GB + SMOTE 0.172 0.170 0.092 0.050 0.031 0.013 TABLE XIV Calibration-in-the-large, Pima and mammography, mean of 10 seeds: signed a, |a| and |a|off with the offset (stars as in Table VII). nat. 1:20 nat. System a |a| |a|off a |a| |a|off a |a| |a|off LR + no correction +0.06 0.15 – +0.01 0.21 – +0.03 0.07 – LR + reweight −0.56†∗ 0.56 0.15 −3.11†∗ 3.11 0.26 −3.61†∗ 3.61 0.16 LR + ROS −0.58†∗ 0.58 0.15 −3.14†∗ 3.14 0.27 −3.62†∗ 3.62 0.15 LR + SMOTE −0.58†∗ 0.58 0.15 −3.23†∗ 3.23 0.35 −3.63†∗ 3.63 0.15 GB + no correction +0.04 0.20 – +0.83 0.90 – +0.22 0.22 – GB + reweight −0.39†∗ 0.39 0.32 −0.79†∗ 0.79 2.18 −2.73†∗ 2.73 1.01 GB + ROS −0.33†∗ 0.33 0.35 −0.79†∗ 0.79 2.17 −2.74†∗ 2.74 1.00 GB + SMOTE −0.38†∗ 0.38 0.34 −1.82†∗ 1.82 1.15 −2.75†∗ 2.75 0.99 and do not assume that the analytic offset works for near- a simulation study,” arXiv preprint arXiv:2404.19494, 2024. separable small-sample fits. [Online]. Available: https://arxiv.org/abs/2404.19494 [8] A. K. Andersen, H. Mehdizavareh, A. Khan, T. Becher, S. Britsch, M. Britsch, M. Bøttcher, S. Winther, P. D. Rohde, References M. H. Jensen, and S. L. Cichosz, “Tipping the Balance: Impact [1] R. van den Goorbergh, M. van Smeden, D. Timmerman, and of Class Imbalance Correction on the Performance of Clinical B. V. Calster, “The harm of class imbalance corrections for risk Risk Prediction Models,” arXiv preprint arXiv:2603.00208, prediction models: illustration and simulation using logistic 2026. [Online]. Available: https://arxiv.org/abs/2603.00208 regression,” arXiv preprint arXiv:2202.09101, 2022. [Online]. [9] W. Sirikul, N. Isaradech, W. Kiratipaisarl, P. Wongyikul, Available: https://arxiv.org/abs/2202.09101 N. Jirattikanwong, and P. Phinyo, “Class Imbalance Corrections [2] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger, “On Failed to Enhance Discrimination, Model Calibration, and Calibration of Modern Neural Networks,” arXiv preprint Prediction Stability: An Empirical Simulation Study Based arXiv:1706.04599, 2017. [Online]. Available: https://arxiv.org/ on Clinical Dataset,” arXiv preprint arXiv:2606.08966, 2026. abs/1706.04599 [Online]. Available: https://arxiv.org/abs/2606.08966 [3] N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. [10] J. H. Friedman, “Greedy function approximation: A gradient Kegelmeyer, “SMOTE: Synthetic Minority Over-sampling boosting machine.” The Annals of Statistics, 2001. [Online]. Technique,” arXiv preprint arXiv:1106.1813, 2011. [Online]. Available: https://doi.org/10.1214/aos/1013203451 Available: https://arxiv.org/abs/1106.1813 [11] T. Chen and C. Guestrin, “XGBoost: A Scalable Tree Boosting [4] G. Lemaitre, F. Nogueira, and C. K. Aridas, “Imbalanced-learn: System,” arXiv preprint arXiv:1603.02754, 2016. [Online]. A Python Toolbox to Tackle the Curse of Imbalanced Datasets Available: https://arxiv.org/abs/1603.02754 in Machine Learning,” arXiv preprint arXiv:1609.06570, 2016. [Online]. Available: https://arxiv.org/abs/1609.06570 [5] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, A. Müller, J. Nothman, G. Louppe, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and Édouard Duchesnay, “Scikit-learn: Machine Learning in Python,” arXiv preprint arXiv:1201.0490, 2012. [Online]. Available: https://arxiv.org/abs/1201.0490 [6] A. D. Pozzolo, O. Caelen, R. A. Johnson, and G. Bontempi, “Calibrating Probability with Undersampling for Unbalanced Classification,” 2015 IEEE Symposium Series on Computational Intelligence, 2015. [Online]. Available: https://doi.org/10.1109/ SSCI.2015.33 [7] A. Carriero, K. Luijken, A. de Hond, K. G. Moons, B. van Calster, and M. van Smeden, “The harms of class imbalance corrections for machine learning based prediction models: