Skip to content

Commit 6470062

Browse files
john-b-yangclaude
andcommitted
Make elo bootstrap rank-stability analysis opt-in (--bootstrap)
The nonparametric+parametric bootstrap refits the whole Bradley-Terry model per sample (1000 each), which is minutes/sample on a large ladder (~days total) and ran unconditionally. Gate it behind --bootstrap (default off) with --n-bootstrap to size it. The ranking and per-fit ±1σ uncertainties are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 89f9d82 commit 6470062

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

  • codeclash/analysis/metrics

codeclash/analysis/metrics/elo.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,19 @@ def write_latex_table_plain(results: dict[str, dict], output_dir: Path) -> None:
15921592
default=ASSETS_DIR / "elo_plots",
15931593
help="Directory to save plots (default: assets/elo_plots)",
15941594
)
1595+
parser.add_argument(
1596+
"--bootstrap",
1597+
action="store_true",
1598+
help="Run the bootstrap rank-stability analysis (nonparametric + parametric). Off by "
1599+
"default: it refits the whole model per sample, so it is very slow (minutes per sample on "
1600+
"a large ladder). The ranking and per-fit ±1σ uncertainties are produced without it.",
1601+
)
1602+
parser.add_argument(
1603+
"--n-bootstrap",
1604+
type=int,
1605+
default=1000,
1606+
help="Bootstrap samples per type when --bootstrap is set (default: 1000).",
1607+
)
15951608
args = parser.parse_args()
15961609

15971610
builder = ScoreMatrixBuilder(
@@ -1637,19 +1650,21 @@ def write_latex_table_plain(results: dict[str, dict], output_dir: Path) -> None:
16371650
write_website_results(results, args.output_dir)
16381651
write_latex_table_plain(results, args.output_dir)
16391652

1640-
if uncertainties_supported:
1653+
if args.bootstrap and uncertainties_supported:
16411654
bootstrap_results = {}
16421655
for bootstrap_type in ["nonparametric", "parametric"]:
16431656
bootstrap_results[bootstrap_type] = BootStrapRankStability(
16441657
builder,
1645-
n_bootstrap=1000,
1658+
n_bootstrap=args.n_bootstrap,
16461659
game="ALL",
16471660
regularization=args.regularization,
16481661
topks=None,
16491662
bootstrap_type=bootstrap_type,
16501663
output_dir=args.output_dir,
16511664
).run()
16521665
write_bootstrap_metrics_table(bootstrap_results, args.output_dir, game="ALL")
1666+
elif uncertainties_supported:
1667+
logger.info("Skipping bootstrap rank-stability analysis (pass --bootstrap to enable).")
16531668

16541669
# Max-round analyses are multi-round-only; skip them for single-round ladder round-robins.
16551670
if not args.include_round_0:

0 commit comments

Comments
 (0)