calibration-check
Skill54 starsChanged 7 days agoMITView on GitHub
Evaluate whether sports-model probabilities match observed frequencies. Use for Brier score, log loss, reliability bins, ECE, segment checks, and recalibration decisions.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Bookie0918/writer-ai-ostheir own version, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Bookie0918/writer-ai-os★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- anti-slop-analyticsSkill
- baseline-modelsSkill
- data-sourcesSkill
- eda-sportsSkill
- environment-setupSkill
- experiment-logSkill
- feature-rulesSkill
- leakage-auditSkill
- model-cardSkill
- model-interpretationSkill
- predictive-modelingSkill
- ratings-strength-modelsSkill
- results-reportingSkill
- simulation-sportsSkill
- sports-modeling-doctrineSkill
- sports-visualizationSkill
- statistical-modelingSkill
- time-series-sportsSkill
- validation-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 14 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
After walk-forward evaluation of a probability model
- Distinctive: line 31
Before writing results that quote probability levels
- Distinctive: line 35
Do not use when:
- Distinctive: line 68
Read calibration_metrics.md when interpreting ECE, Brier score, log loss, or sharpness.
- Distinctive: line 83
If recalibrating, only with nested/train-proper methods — never fit isotonic on the final test fold and call it validated.
- Distinctive: line 84
Write the calibration report into experiment log / results writeup.
- Distinctive: line 98
Before issuing one, verify that predictions are genuinely held out and walk-forward, inspect uncertainty and populated-bin counts, compare …
- Distinctive: line 101
No universal ECE cutoff establishes that probabilities are trustworthy.
- Distinctive: line 149
Always report bin counts. Empty bins are not evidence.
- Distinctive: line 163
After recalibration, re-report ECE/Brier on true forward folds.
- Distinctive: line 169
Never evaluate calibration on training rows used to fit the same model without nested disclosure.
- Distinctive: line 170
Never present raw scores as probabilities without checking calibration.
- Distinctive: line 171
Never hide segment failures behind a pooled “looks fine.”
- Distinctive: line 172
If sample per bin is tiny, say so — widen bins or reduce claim strength.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Calibration Check (Sports)
Overview
A model can rank teams well and still be miscalibrated. If the model says 30%, about 30% of those cases should hit.
This skill measures probability reliability for sports models and supports a human-reviewed verdict grounded in evaluation provenance, uncertainty, and segment stability.
Discrimination metrics (AUC, accuracy) do not replace calibration.
When to Use This Skill
Use when:
- Model outputs win/event probabilities
- User asks how confident / how reliable the probs are
- After walk-forward evaluation of a probability model
- Before writing results that quote probability levels
- Comparing raw vs recalibrated probabilities
- sport- and competition-specific probability artifacts
Do not use when:
| Need | Go instead |
| Pure ranking tasks with no probabilistic interpretation | ranking/eval skills |
| Hard labels only with no probability outputs | classification metrics only |
| Designing splits from scratch | validation-design |
| Feature legality review | leakage-audit |
| Margin-only models without probs | MAE/RMSE reporting |
Installation
Compute calibration in the user's environment:
python -m pip install pandas numpy scikit-learn pyarrowAccept the user's CSV, Parquet, or JSON prediction table. This repository does not ship a calibration program.
What to Measure
- Reliability / calibration curve — bin predicted prob vs observed rate
- Expected Calibration Error (ECE)
- Brier score (+ reliability/resolution decomposition when useful)
- Log-loss — discrimination + calibration together; not a substitute for ECE
- Segment calibration — by season, home/away, probability tail
- Sharpness — are probs informative, not all ~0.5?
Read calibration_metrics.md when interpreting ECE, Brier score, log loss, or sharpness. Read binning.md before choosing bin edges or minimum counts. Read recalibration.md before fitting Platt, isotonic, or another probability correction.
Workflow
- Confirm predictions come from time-safe / walk-forward folds.
- Validate probabilities in
[0, 1]; account for every excluded row. - Pre-declare binning (fixed-width or quantile).
- Compute curve, ECE, Brier, log-loss.
- Slice by season and by probability tails.
- Issue a verdict (table below).
- If recalibrating, only with nested/train-proper methods — never fit isotonic on the final test fold and call it validated.
- Write the calibration report into experiment log / results writeup.
Verdict Scale
| Verdict | Meaning |
well-calibrated | Reliability acceptable for quoting probabilities |
usable-with-caveats | Some miscalibration; disclose and/or recalibrate properly |
poorly-calibrated | Probability numbers not trustworthy as probabilities |
invalid-eval | Leakage/split issues block judgment |
These verdicts belong to the full methodology, not to a single ECE threshold. Before issuing one, verify that predictions are genuinely held out and walk-forward, inspect uncertainty and populated-bin counts, compare seasons or folds, check decision-relevant segments, and document the prediction source. No universal ECE cutoff establishes that probabilities are trustworthy.
Run on Held-Out Prediction Artifacts
The input must contain one row per evaluated decision, a binary outcome, and a
probability in [0, 1].
Preferred column names from baseline-models:
- outcome:
y_true - probability:
p_pred(the same value may also be stored aslogistic_probability)
For a symmetric team-game table, filter to one perspective per game (is_home == 1, or one row from games) before scoring. Do not double-count both sides of one event.
Report Brier score, log loss, ECE, reliability-bin counts, row accounting, and optional group metrics. A numeric summary cannot prove held-out provenance or turn a favorable pooled ECE into well-calibrated; apply the verdict scale above. Also report all-row, categorical-segment, probability-tail metrics, and sparse-bin counts.
predictions is the table from baseline-models (y_true, p_pred).
import numpy as np
from sklearn.metrics import brier_score_loss, log_loss
y = predictions["y_true"].to_numpy()
p = np.clip(predictions["p_pred"].to_numpy(), 1e-6, 1 - 1e-6)
bin_id = np.minimum(np.digitize(p, np.linspace(0, 1, 11)) - 1, 9)
ece, rows = 0.0, []
for b in range(10):
m = bin_id == b
n = int(m.sum())
mean_p, obs = (float(p[m].mean()), float(y[m].mean())) if n else (None, None)
ece += (n / len(y) * abs(obs - mean_p)) if n else 0.0
rows.append({"bin": b, "n": n, "mean_p": mean_p, "obs_rate": obs})
print({"brier": float(brier_score_loss(y, p)), "log_loss": float(log_loss(y, p)), "ece": ece})
print(rows)Binning Guidance
| Strategy | Use when |
| Equal-width (10 bins 0–1) | default sports win probs |
| Quantile bins | probs clump in a narrow range |
| Tail focus (0–0.2, 0.8–1.0) | decisions live in extremes |
Always report bin counts. Empty bins are not evidence.
Recalibration Rules
Allowed
- Platt scaling / isotonic fit inside training folds only, applied to test fold
- Nested walk-forward recalibration
Not allowed
- Fit isotonic on final test labels and call it validated
- Hand-edit probabilities after seeing outcomes
After recalibration, re-report ECE/Brier on true forward folds.
Hard Constraints
- Never evaluate calibration on training rows used to fit the same model without nested disclosure.
- Never present raw scores as probabilities without checking calibration.
- Never hide segment failures behind a pooled “looks fine.”
- If sample per bin is tiny, say so — widen bins or reduce claim strength.
- Accuracy is not calibration.
- Leakage-invalid evaluations cannot be “well-calibrated.”
Anti-Patterns
- “56% correct, so calibrated”
- One reliability plot with no sample sizes
- Holdout isotonic theater
- Average prob ≈ base rate therefore calibrated (necessary, not sufficient)
- Ignoring 0.05 and 0.95 tails
- Quoting NBA/MLB percents without sport-specific calibration
Reporting Template
Calibration report
Sport/model:
Eval: walk-forward seasons …
n:
Brier:
ECE (bins=…):
Log-loss:
Notes by season:
Tail behavior:
Verdict: well-calibrated | usable-with-caveats | poorly-calibrated | invalid-eval
Actions:
Reproduce:Output Contract
Done means:
- Walk-forward probs used
- ECE/Brier/log-loss reported
- Bin counts or segment notes present
- Verdict issued
- Actions stated
Worked Example
Example finding: predictions near 0.70 occur in sparse bins and realize near 0.60. Label the tail unstable or overconfident according to its uncertainty; do not infer a durable defect from a handful of rows.
References
references/
| File | Contents |
| calibration_metrics.md | ECE/Brier/log-loss definitions |
| binning.md | bin strategy notes |
| recalibration.md | allowed recalibration patterns |
Related Skills
| Need | Skill |
| Validation design | validation-design |
| Predictive models | predictive-modeling |
| Statistical models | statistical-modeling |
| Results writeup | results-reporting |
| Model card | model-card |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

