Open source · Python & R
Is your leaderboard winner real?
A ranking can hinge on a handful of lucky periods. selection‑fragility deletes the luckiest ones and shows you whether the winner survives — or flips. Here it runs the real statistics, live in your browser.
$
pip install selection-fragility
♔
⚑ Fragile
🔒 Runs entirely in your browser — nothing is uploaded
·
R == Python, bit-identical
·
MCS: Hansen–Lunde–Nason (2011)
·
MIT · PyPI · CRAN (in review) · Zenodo DOI
See it on your data
Paste your own leaderboard, or pick an example
First column = period label (week, task group, location…). Every other column = a model's loss, lower is better.
LLM leaderboard
Real dataStanford HELM Lite: 8 top LLMs, 10 scenarios. One scenario decides #1.
Stanford HELM (Holistic Evaluation of Language Models) — a public LLM
benchmark. Columns are models (GPT-4o, Claude 3.5 Sonnet, DeepSeek v3,
Llama 3.1, Amazon Nova …); rows are scenarios — e.g. MMLU (knowledge),
GSM8K / MATH (math), MedQA (medicine), LegalBench (law), NarrativeQA (reading),
WMT (translation). Cells are loss = 1 − accuracy (lower = better).
Source: Stanford CRFM, HELM Lite v1.13.0.
Flu forecasting
Real dataCDC FluSight 2022–23: 7 teams, 31 weeks. The unanimous winner is fragile.
CDC FluSight — the U.S. CDC's open influenza-forecasting challenge. Each
column is a forecasting team's model; each row is a week. Cells are
relative WIS (the weighted interval score ÷ the FluSight baseline; lower =
more accurate). Teams include PSI-DICE, MOBS-GLEAM_FLUH (a mechanistic
GLEAM epidemic model from the MOBS Lab, Northeastern), CMU-TimeSeries
(Carnegie Mellon) and Flusight-ensemble (the hub's combined forecast).
Source: Mathis et al. (2024), Nature Communications, CC-BY-4.0.
Weekly forecast error
IllustrativeFour models, 12 weeks. The winner rides two lucky weeks.
A clear winner
IllustrativeDeleting periods never changes the ranking — robust.
♔
⚑ Fragile
Or bring your own — paste or upload a CSV
warming up…
How it works
The rigor, one glance away
The demo is the quick read. Here's exactly what it computes — and where it can mislead.
› What counts as a “period”?
A period is one row of your loss panel — a week, a task group, a location, a forecast round. k* is the fewest rows you can delete before the top of the ranking changes. Choose rows to be the unit you actually care about being robust to; if you want robustness across locations, make each location a row.
› What are k* and the Model Confidence Set?
k* counts how many worst-case periods must be removed to flip the leaderboard winner — small k* means the lead is sensitive. The Model Confidence Set (Hansen, Lunde & Nason 2011) is the set of models that can't be statistically separated from the best at the 95% level; a set larger than one means the top models are effectively tied.
› When can this mislead?
Deletion is worst-case and greedy, so k* is a lower bound on robustness, not a verdict of fraud. A small k* with an identified winner means the lead is real but thin; aggregation choices (e.g. averaging across locations before vs. after deletion) change what “a period” means. Read k* alongside the MCS, never alone.
› Full report() output
—
Quickstart
Same answer in Python or R
pip install selection-fragility
import selection_fragility as sf
panel = sf.LossPanel.from_losses(losses, labels=weeks)
print(sf.report(panel)) # verdict + leaderboard
sf.fragility(losses)["k_star"] # how many periods to flip