\textbf{Data and tasks.} \emph{Breast cancer Wisconsin (diagnostic)} from scikit-learn: [[c:n_patients]] patients, [[c:n_features]] numeric features computed from digitised images of fine-needle aspirates of breast masses (cell-nucleus size, shape and texture), [[c:n_malignant]] malignant (positive) and [[c:n_benign]] benign. It is a tabular diagnostic data set with one row per patient; it is not electronic-health-record data and not a clinical time series. Task \texttt{bc\_natural} uses the data as is. For ratios $k\in\{5,20,50\}$ (\texttt{bc\_1to5}, \texttt{bc\_1to20}, \texttt{bc\_1to50}) we make the \emph{training} set imbalanced: after a stratified 70/30 split (seeded), training positives are subsampled to $n_1=\mathrm{round}(n_0/k)$, which gives 50, 12 and 5 positives in every split (the natural split has [[a:main/LR + no correction/bc_natural/n_train_pos/mean:0]]). Subsampling the whole data to 1:50 would leave about 7 positives in total, so every held-out example is kept (64 malignant, [[c:n_test_benign]] benign) and the test positives get a common weight $w$ so that the \emph{weighted} test prevalence equals the \emph{realised} training prevalence $\pi=n_1/(n_0+n_1)$, i.e.\ $w=\big(n_0^{\text{test}}\,n_1/n_0\big)/n_1^{\text{test}}$; all metrics are weighted. The nominal ratio $1{:}k$ and the realised prevalence differ only at $k=20$: there $n_0=[[c:n_train_benign]]$, $n_1=12$ and $\pi=12/[[a:main/LR + no correction/bc_1to20/n_train/mean:0]]$ (odds about $1{:}21$). Round~1 of this study used the nominal ratio for the test weights, so at 1:20 the evaluation prevalence was $1/21$ while the threshold and the prior-shift offset used $\pi$; all runs of the main, offset and sweep groups were rerun with the realised prevalence (the earlier rows are superseded in \texttt{results/runs.jsonl}), and the numbers below are from the rerun. Weighting tests calibration at the deployment prevalence but reduces the effective number of positives at 1:50 (Limitations).

\textbf{Clinical data sets with lower discrimination (added in round~1).} \emph{Pima Indians diabetes} (OpenML id [[c:openml_id_pima]], [[c:n_pima]] women, 8 clinical measurements, [[c:n_pima_pos]] with diabetes; zeros are kept as in the source) is run with the same four tasks as above (\texttt{pima\_natural}, \texttt{pima\_1to5}, \texttt{pima\_1to20}, \texttt{pima\_1to50}; the positives are subsampled in the training split as for breast cancer). \emph{Mammography} (OpenML id [[c:openml_id_mammo]], [[c:n_mammo]] examinations, 6 image-derived attributes, [[c:n_mammo_pos]] positive, event rate about two per cent) is already imbalanced and is run at its natural prevalence only (\texttt{mammo\_natural}, unweighted test split). Both are fetched from OpenML with scikit-learn (the cached copy lives in the git-ignored \texttt{data/} directory). The protocol is that of the main groups: systems of Table~\ref{tab:main} (10 arms), the prior-shift offset on reweighting, ROS and SMOTE.

\textbf{Systems and protocol.} Five strategies $\times$ two learners $\times$ four breast-cancer tasks (and the five Pima and mammography tasks) $\times$ 10 seeds (0--9; each seed changes the split, the positive subsample and the resampling randomness): [[k:count/main/runs]] runs of \texttt{method/run.py} in group \texttt{main} with identical code, data pipeline and metric definitions. In the main groups hyperparameters are fixed (Section~\ref{sec:method}); no system is tuned, so the tuning budget is equal (zero). Correction target ratio is 1:1 unless stated. Ablations: the prior-shift offset on reweighting, ROS and SMOTE for both learners and all tasks ([[k:count/abl_priorcorr/runs]] runs), and a sweep of the SMOTE target ratio $r\in\{[[c:sweep_ratio_a:2]],[[c:sweep_ratio_b:2]],[[c:sweep_ratio_c:2]],[[c:sweep_ratio_d:2]]\}$ plus the main runs at $r=1$, both learners, at 1:20 ([[k:count/sweep_smote_ratio/runs]] runs). Reference arm (``method'' in the run registry): LR with no correction.

\textbf{Controls added in round~1.} All use the same splits, seeds and metrics (breast cancer, four tasks, 10 seeds) and the same budget for every system:
(i)~\emph{Equal-budget tuning} (group \texttt{ctrl\_tuned}, all five strategies, both learners): an inner stratified 3-fold cross-validation on the training split chooses the hyperparameters from a fixed grid, with the same grid, folds and criterion for every system: the pooled held-out log-loss on the \emph{unresampled} held-out folds (the system, including any resampling, is refitted on each training part). The grid is five values of $C$ for LR, from [[c:lr_grid_c_min:2]] to [[c:lr_grid_c_max:0]] in steps of a factor ten and, for GB with [[c:gb_n_trees]] trees and learning rate [[c:gb_learning_rate:1]], tree depth $\{1,2,3\}\times$ minimum leaf size $\{1,10\}\times$ subsample fraction $\{[[c:gb_subsample_low:1]],1\}$ (12 points). Ties go to the first grid point. The selected hyperparameters are logged with each run.
(ii)~\emph{Recalibration} (groups \texttt{ctrl\_recal\_platt}, \texttt{ctrl\_recal\_isotonic}; no correction, reweighting, ROS and SMOTE, both learners, default hyperparameters): a Platt (logistic on the logit of the risk, effectively unpenalised) or isotonic map is fitted on out-of-fold risks of the \emph{training} split (3 folds; the system is refitted on each training part and applied to the untouched held-out part), then applied to the risks of the model fitted on the whole training split. The test split is never used.
(iii)~\emph{Normalised loss weight} (group \texttt{ctrl\_normw}, LR with ROS or SMOTE): every row of the resampled set gets weight $n_{\text{train}}/n_{\text{fit}}$ so that the total loss weight equals that of the original training set and of balanced reweighting (which sums to $n_{\text{train}}$).
(iv)~\emph{Specificity-matched cut-off} (group \texttt{ctrl\_opmatch}, the three corrections, both learners): for each run, threshold moving's operating point is computed (no-correction model, cut-off $\pi$), and the corrected model is evaluated at the smallest cut-off whose weighted specificity is at least that of threshold moving. This uses the test labels to pick the cut-off and is a diagnostic, not a deployable rule.

\textbf{Simulation (added in round~1).} Group \texttt{sim\_offset} (\texttt{method/sim.py}): features $x\sim N(0,I_{10})$, true risk $\sigma(a_0+s\,z)$ with $z=\sum_j x_j/\sqrt{10}$, a correctly specified logistic model, with $a_0$ set so that the prevalence is $[[c:sim_prevalence:2]]$. Training size $n\in\{[[c:sim_n_small]],[[c:sim_n_mid]],[[c:sim_n_large]]\}$ (about a dozen, fifty and two hundred positives), signal strength $s\in\{1,2,4,8\}$ (from a weak to a near-separable true risk), LR penalty $C\in\{[[c:lr_grid_c_min:2]],1,[[c:lr_grid_c_max:0]]\}$, 20 seeds per cell, a test sample of [[c:sim_n_test]] iid rows at the natural prevalence (unweighted). In each run LR is fitted with no correction, reweighting, ROS and SMOTE, each raw and with the prior-shift offset.

\textbf{Statistics.} Differences to the same learner without correction are paired by seed, with a two-sided paired $t$-test. Unadjusted $p$-values are reported with Holm-adjusted ones: within each family of tests (one metric across all learner $\times$ correction $\times$ task cells of one data set; threshold-moving comparisons by metric and reference set) the Holm step-down procedure gives the adjusted $p$. The families are defined in \texttt{analysis/derive.py}. All derived statistics are computed by that script, logged through \texttt{rh run} (group \texttt{derived}) and quoted from the registry. The registry holds the statistics the paper quotes or marks (the TeX macros of all registry values must fit TeX's string pool); every statistic of every family is also written to \texttt{results/tables/derived\_full/}, and the correction-versus-no-correction $p$-values agree exactly with \texttt{rh compare} (\texttt{results/tables/compare\_crosscheck.txt}). Unadjusted $p<[[c:alpha:2]]$ cells that do not survive Holm are suggestive only. Calibration slope is heavy-tailed (the registry holds values from [[d:extremes/min_slope:2]] to [[d:extremes/max_slope:1]]), so slopes and $|b-1|$ are reported as medians with interquartile ranges; all other metrics as means.

\textbf{Hypotheses (registered in \texttt{proposal.md} before the main runs).} H1: reweighting, ROS and SMOTE give no AUROC/AUPRC gain of at least [[c:h1_gain_threshold:2]] over no correction (refuted for a cell if the mean paired gain is $\ge[[c:h1_gain_threshold:2]]$ with $p<[[c:alpha:2]]$; a non-refutation is not evidence of equivalence). H2: they raise Brier score and $|a|$ at 1:20 and 1:50. H3: threshold moving leaves probability metrics identical and trades specificity for sensitivity. H4: with the prior-shift offset, Brier score of the corrected systems is within [[c:h4_brier_tolerance:3]] of no correction.

\textbf{Hardware and runtime.} CPU only; each run takes a few seconds (tuned gradient boosting up to about ten). One early sanity run failed (missing output directory) and was rerun; it stays in the registry.
