agentleFS
WalrusQuantWalrusQuant/sports-analytic-skills/skills/model-interpretation/SKILL.md

model-interpretation

Skill54 starsChanged 6 days agoMITView on GitHub

Interpret sports models using held-out predictions, coefficients, error slices, largest misses, calibration context, and stability checks. Use after time-aware evaluation when explaining what drives a model and where it fails.

  • Installs packages

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 12 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    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
  1. Distinctive:

    After win / margin / Elo pipelines finish

    line 35
  2. Distinctive:

    Do not use when:

    line 41
  3. Distinctive:

    Restate global metrics with baseline: before any story.

    line 88
  4. Distinctive:

    Use miss_taxonomy.md when classifying large errors and deciding which failures suggest data repair, a new feature, drift handling, or no …

    line 114
  5. Distinctive:

    Do not call it causal without design

    line 132
  6. Distinctive:

    Check VIF / collinearity before story-time (form diffs often collinear)

    line 133
  7. Distinctive:

    Prefer permutation importance on held-out folds if used at all

    line 136
  8. Distinctive:

    Never only show the funniest blowup.

    line 156
  9. Distinctive:

    Never interpret a model that failed leakage.

    line 162
  10. Distinctive:

    Never treat coefficient sign as causal without design.

    line 163
  11. Distinctive:

    Never hide slices where the model loses.

    line 164
  12. Distinctive:

    If slices conflict with the mean story, the mean story is incomplete.

    line 168

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Model Interpretation (Sports)

Overview

Explain model behavior after evaluation — never instead of evaluation.

Interpretation answers:

  • what the model relies on
  • where it fails
  • whether failures concentrate (season, home/away, probability tails)
  • whether the story is stable enough to put in a model card

It does not turn a losing walk-forward into a win.

Work from held-out prediction tables, fold summaries, and model-specific coefficient or importance artifacts.


When to Use This Skill

Use when:

  • After win / margin / Elo pipelines finish
  • Debugging bad folds
  • Writing results or model cards
  • User asks “why,” “largest misses,” “where does it break,” “what drives this”
  • Comparing two models on the same walk-forward folds

Do not use when:

NeedGo instead
No held-out predictions yetpredictive-modeling first
Leakage still openleakage-audit
Pure presentation cleanupanti-slop-analytics
Only global metrics writeupresults-reporting
Probability reliability deep-divecalibration-check

Installation

Slice errors in the user's environment:

python -m pip install pandas numpy pyarrow

Inputs are the user's CSV, Parquet, or JSON.


Required Inputs

Minimum:

  • Walk-forward metrics (pipeline JSON or fold table)
  • Predictions + actuals with stable reconciliation keys and a fold/season label; team, opponent, and home/away context when those slices are needed
  • Baseline metrics on the same folds
  • Leakage audit status

Optional:

  • Feature matrix used at fit time
  • Coefficients / importances
  • Calibration table

Analysis Workflow

Do not skip.

  1. Confirm evaluation is walk-forward (not in-sample flex).
  2. Restate global metrics with baseline before any story.
  3. Confirm leakage status is CLEAN (or stop).
  4. Slice errors by season, home/away, probability bins, margin buckets.
  5. List largest misses with context (favorite blown out, early season, etc.).
  6. Read drivers carefully
    • linear: coefficients with scale/standardization caveats
    • trees: slice stability over one importance bar chart
  7. Check calibration context for probability models.
  8. Write limits — what interpretation cannot claim.
  9. Hand off to results-reporting / model-card / next experiment.

Slice Menu (do at least two)

SliceQuestion
Season / foldDoes one year carry the mean?
Home vs awayIs edge only one side of the panel?
Probability tailsAre 10% and 90% calls reliable?
Early season (pre_games_played low)Cold-start failure?
Large absolute elo_diff or form gapDoes it fail on “easy” games too?
Blowout residuals (margin)Systematic scale miss?

Guide: slice_guide.md Methods: interpretation_methods.md Use miss_taxonomy.md when classifying large errors and deciding which failures suggest data repair, a new feature, drift handling, or no action.


Error tables

Expect y_true, a probability column such as logistic_probability or p_pred, and a fold or season label from the prediction table. Map other names explicitly. Keep team, opponent, and home/away columns when those slices are required. Check that outcomes are binary and probabilities lie in [0, 1]. For a symmetric team-game table, filter to one row per event before ranking misses.

Probability-error tables do not produce coefficient scaling, permutation importance, causal claims, or margin residuals. Those need the fitted model and the methods below.


Coefficient / Driver Rules

Logistic / linear

  • Report direction + magnitude with feature scale
  • Standardized features: coefficient is per-SD effect
  • Do not call it causal without design
  • Check VIF / collinearity before story-time (form diffs often collinear)

Trees / GBM

  • Prefer permutation importance on held-out folds if used at all
  • Require stability across seasons before believing a top feature
  • A pretty importance chart is not lift

Elo models

  • elo_diff dominating is expected — say so
  • Interpretation is mostly “rating gap + home,” not mysterious structure

Largest Misses Protocol

For each miss report:

  1. season, week/date, team, opponent, is_home
  2. y vs p_hat (or margin residual)
  3. model edge (favorite/underdog)
  4. simple context features (form gap, elo gap, rest if present)
  5. whether this miss type clusters

Never only show the funniest blowup.


Hard Constraints

  1. Never interpret a model that failed leakage.
  2. Never treat coefficient sign as causal without design.
  3. Never hide slices where the model loses.
  4. Probability tails need calibration context.
  5. One season hero story is not generalization.
  6. Global metric + baseline must appear before narrative.
  7. If slices conflict with the mean story, the mean story is incomplete.

Anti-Patterns

  • Feature importance theater without metric lift
  • Explaining noise as narrative
  • Only best-case slices
  • Confusing form features with “true team quality”
  • Post-hoc story after seeing test labels without labeling it post-hoc
  • “The model understands matchups” without slice evidence

Reporting Template

Model:
Sport / target / T:
Walk-forward window:
Global metrics vs baseline:
Leakage status:
Slices:
  - season:
  - home/away:
  - tails:
Largest misses:
Stable drivers:
Unstable / discarded stories:
Limits:
Next test:

Output Contract

Done means:

  • Global metrics restated with baseline
  • Leakage status stated
  • At least two slices reported
  • Largest misses listed with context
  • Driver claims caveated
  • Limits of interpretation stated
  • Next test named if follow-up needed

Worked Example

NFL form logistic, 2021–2025 walk-forward

  1. Mean log-loss beats constant → proceed
  2. Leakage CLEAN
  3. Slice by season: check whether one season carries the result
  4. Slice home/away: both should beat constant if the model is real
  5. Largest misses: road dogs that won, or huge favorites that lost
  6. Writeup: “beats constant on most folds; weak on early-season low-sample rows”

References

references/

  • interpretation_methods.md
  • slice_guide.md
  • miss_taxonomy.md

Related Skills

  • results-reporting
  • calibration-check
  • model-card
  • predictive-modeling
  • statistical-modeling
  • experiment-log

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.