\textbf{Prior-shift offset (H4).} We add the logit offset of Eq.~(1) to reweighting, ROS and SMOTE ($\pi_{\text{eff}}=[[c:default_cutoff:1]]$ in all three) for both learners and all four tasks, with $\pi$ the realised training prevalence. AUROC changes in one cell only (GB with ROS at 1:5, where clipping ties saturated predictions; largest per-run change [[d:summary_prior_bc/auroc_maxdiff_max:4]]). Table~\ref{tab:abl_brier} gives the mean Brier score without (raw) and with the offset next to the no-correction value of the same learner, so the Brier gap to no correction is the difference to that row; Table~\ref{tab:citl} the calibration-in-the-large.

\begin{table*}[t]\centering\caption{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.}\label{tab:abl_brier}
\small\input{generated/abl_prior_brier.tex}
\end{table*}

\begin{table*}[t]\centering\caption{Calibration-in-the-large, breast cancer, mean of 10 seeds: signed $a$ ($>0$: risk underestimated), $|a|$, and $|a|_{\text{off}}$ with the prior-shift offset. $^{*}$: $a$ differs from no correction, same learner, unadjusted paired $p<[[c:alpha:2]]$; $^{\dagger}$: Holm-adjusted $p<[[c:alpha:2]]$.}\label{tab:citl}
\small\input{generated/citl.tex}
\end{table*}

H4 as registered (corrected Brier within [[c:h4_brier_tolerance:3]] of no correction) holds in [[d:summary_prior_bc/both_within:0]] of 24 cells; the exception is GB with SMOTE at 1:5, where the Brier score with the offset is [[a:abl_priorcorr/GB + SMOTE + prior corr/bc_1to5/brier/mean:3]] against [[a:main/GB + no correction/bc_1to5/brier/mean:3]] for no correction (\emph{better} than no correction, as is the raw model at [[a:main/GB + SMOTE/bc_1to5/brier/mean:3]]). The criterion is weak: the raw gaps are already within [[c:h4_brier_tolerance:3]] in [[d:summary_prior_bc/both_rawwithin:0]] of 24 cells (the exceptions are GB with SMOTE at 1:5 and at 1:20, where the raw Brier score is [[a:main/GB + SMOTE/bc_1to20/brier/mean:3]] against [[a:main/GB + no correction/bc_1to20/brier/mean:3]] for no correction, which the offset brings to [[a:abl_priorcorr/GB + SMOTE + prior corr/bc_1to20/brier/mean:3]]). The offset does not move Brier score consistently toward no correction: the gap shrinks in magnitude in [[d:summary_prior_bc/both_shrinks:0]] of 24 cells ([[d:summary_prior_bc/lr_shrinks:0]] of 12 for LR, [[d:summary_prior_bc/gb_shrinks:0]] of 12 for GB). The offset also raises mean $|a|$ in all [[d:summary_prior_bc/both_citl_up:0]] of 24 cells (with unadjusted $p<[[c:alpha:2]]$ in [[d:summary_prior_bc/both_citl_up_sig:0]]): LR at 1:20 goes from $|a|=$ [[a:main/LR + reweight/bc_1to20/citl_abs/mean:2]] (reweight), [[a:main/LR + ROS/bc_1to20/citl_abs/mean:2]] (ROS) and [[a:main/LR + SMOTE/bc_1to20/citl_abs/mean:2]] (SMOTE) to [[a:abl_priorcorr/LR + reweight + prior corr/bc_1to20/citl_abs/mean:2]], [[a:abl_priorcorr/LR + ROS + prior corr/bc_1to20/citl_abs/mean:2]] and [[a:abl_priorcorr/LR + SMOTE + prior corr/bc_1to20/citl_abs/mean:2]], against [[a:main/LR + no correction/bc_1to20/citl_abs/mean:2]] for no correction (Table~\ref{tab:citl}). The arithmetic is that the offset shifts every logit by $\log\frac{\pi}{1-\pi}-\log\frac{\pi_{\text{eff}}}{1-\pi_{\text{eff}}}\approx-3$ at 1:20 and therefore raises $a$ by about 3; the raw corrected LR models overestimated risk by less than one logit ($a=$ [[a:main/LR + SMOTE/bc_1to20/cal_citl/mean:2]] to [[a:main/LR + reweight/bc_1to20/cal_citl/mean:2]] at 1:20), so the offset overshoots into a strong underestimate. We read H4 as \emph{refuted in spirit} on this data set (no repair, higher $|a|$) although the registered threshold is formally met in [[d:summary_prior_bc/both_within:0]] cells. The next paragraph and Section~\ref{sec:clin} examine when the offset works.

\textbf{Simulation: when does the offset work? (added in round~1).} Section~\ref{sec:setup} describes the controlled simulation (correctly specified logistic model, prevalence [[c:sim_prevalence:2]], $n\in\{[[c:sim_n_small]],[[c:sim_n_mid]],[[c:sim_n_large]]\}$ training rows with about a dozen, fifty and two hundred positives, signal strength $s\in\{1,2,4,8\}$, $C\in\{[[c:lr_grid_c_min:2]],1,[[c:lr_grid_c_max:0]]\}$, 20 seeds per cell). Table~\ref{tab:sim} gives the signed intercept of ROS without and with the offset; reweighting and SMOTE behave alike (they are included in the averages below). Without correction the intercept is close to zero everywhere (largest cell mean $|a|$ [[d:sim_summary/none_absmax:2]]). Every correction without the offset has a cell-mean intercept between [[d:sim_summary/raw_min:1]] and [[d:sim_summary/raw_max:1]] logits (overestimation), near the analytic shift of about $-3$. With the offset the intercept is closer to zero than without it in [[d:sim_summary/off_closer:0]] of [[d:sim_summary/ncells:0]] cells and within $\pm[[c:sim_tolerance:2]]$ in [[d:sim_summary/n_off_within_025:0]] cells, so in a correctly specified model the offset repairs the intercept in most cells. It overshoots ($a>[[c:sim_tolerance:2]]$, an underestimate) in [[d:sim_summary/n_off_over_025:0]] cells and undershoots in [[d:sim_summary/n_off_under_m025:0]]. The overshoot grows with the signal strength (mean offset-corrected $a$ over the corrections and cells: [[d:sim_summary/bysg_1_off:2]] at $s=1$, [[d:sim_summary/bysg_2_off:2]] at $s=2$, [[d:sim_summary/bysg_4_off:2]] at $s=4$ and [[d:sim_summary/bysg_8_off:2]] at $s=8$), with a stronger penalty ([[d:sim_summary/byC_0.01_off:2]], [[d:sim_summary/byC_1_off:2]] and [[d:sim_summary/byC_100_off:2]] for $C=[[c:lr_grid_c_min:2]],1,[[c:lr_grid_c_max:0]]$) and with fewer training cases ([[d:sim_summary/byn_250_off:2]], [[d:sim_summary/byn_1000_off:2]] and [[d:sim_summary/byn_4000_off:2]] for $n=[[c:sim_n_small]],[[c:sim_n_mid]],[[c:sim_n_large]]$). The mechanism visible in the logs is that in near-separable or heavily penalised fits the corrected model absorbs only part of the analytic shift: the fraction of the offset by which the raw intercept actually moved averages [[d:sim_summary/bysg_1_frac:2]] at $s=1$ and [[d:sim_summary/bysg_8_frac:2]] at $s=8$ ([[d:sim_summary/byC_0.01_frac:2]] at $C=[[c:lr_grid_c_min:2]]$), so adding the full offset overshoots. The largest overshoot is [[d:sim_summary/off_max:2]] logits. This reproduces the sign of the breast-cancer failure (near-separable, few positives) but not its size: on breast cancer the offset moves $|a|$ from below one logit to above two (Table~\ref{tab:citl}), more than in any simulated cell. The simulation uses 10 independent features and a correctly specified model; breast cancer has 30 correlated features and 5 to 12 positives, which we did not simulate, so the full breast-cancer failure is not explained by this simulation.

\begin{table*}[t]\centering\caption{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).}\label{tab:sim}
\small\input{generated/sim.tex}
\end{table*}

\textbf{SMOTE target ratio.} Fig.~\ref{fig:sweep} varies the target ratio $r$ at 1:20 ($r=1$ is the main-group SMOTE rows). For LR, Brier score and AUPRC are flat in $r$ and close to the no-correction level. For GB both are noisy: Brier score is lowest at an intermediate ratio ([[k:sweep_smote_ratio/gb-+-smote@smote_ratio=0.5/bc_1to20/brier/mean:3]] at $r=[[c:sweep_ratio_c:2]]$) and highest at $r=1$ ([[a:main/GB + SMOTE/bc_1to20/brier/mean:3]]), and AUPRC dips at $r=[[c:sweep_ratio_d:2]]$ ([[k:sweep_smote_ratio/gb-+-smote@smote_ratio=0.75/bc_1to20/auprc/mean:3]]), which looks like seed noise given the seed sd of [[a:main/GB + ROS/bc_1to20/auprc/std:2]]--[[a:main/GB + no correction/bc_1to20/auprc/std:2]] in Table~\ref{tab:main}. We claim no trend; the sweep covers one task and one correction.

\begin{figure}[t]\centering\includegraphics[width=\columnwidth]{fig_sweep_smote.pdf}
\caption{SMOTE target ratio at 1:20: Brier score and AUPRC (mean, normal-approximation [[c:interval_level_pct]]\% interval over 10 seeds); dotted lines are the no-correction means.}\label{fig:sweep}\end{figure}
