A paper's ablation table lists a baseline and several changes, each trained with a handful of seeds. Build the table from the raw runs: per-config means and spreads, the difference from the baseline matched by seed, an exact sign-flip p-value for each change, and a Holm correction across all the changes.
Implement ablation_table(runs, baseline, higher_is_better=True, alpha=0.05):
runs: a list of (config, seed, metric) tuples. config is a string, seed an int, metric a float. Each (config, seed) pair appears at most once. Configs may have different sets of seeds.baseline: the name of the baseline config (it has at least one run).higher_is_better: the metric's direction, used only for the verdict.For the baseline and for every other config, n is its number of runs, mean the mean of its metrics and std their sample standard deviation (ddof=1), or None when n is 1.
For each non-baseline config:
paired is their number . The differences are . delta is the mean of (None when ).t with the sample standard deviation (ddof=1) of . None when or .p is the fraction of them with . None when . It is an exact multiple of ; do not round it.p is not None, sort by p ascending. The adjusted value at sorted position is the running maximum of . That is p_holm (unrounded); None when p is None."untested" when p is None. Otherwise, when p_holm <= alpha, "helped" if delta moves the metric in the good direction (positive when higher_is_better, negative otherwise) and "hurt" if not. Otherwise "noise".Return {"baseline": {"n", "mean", "std"}, "rows": [...]} where each row is a dict with keys in this order: config, n, mean, std, paired, delta, t, p, p_holm, verdict. Rows are sorted by config name. mean, std, delta and t are rounded to 4 decimals.