Logo Model Interpretation

Model Interpretation

Cộng đồng
WalrusQuant
model-interpretation

Diễn giải mô hình thể thao bằng các dự đoán trên dữ liệu giữ lại, hệ số, phân tích lỗi theo nhóm, những sai lệch lớn nhất, bối cảnh hiệu chuẩn và các bước kiểm tra độ ổn định. Dùng sau khi đánh giá theo thời gian để giải thích những yếu tố chi phối mô hình và những điểm mô hình không xử lý tốt.

Add to TypingMind

Tổng quan

Nhà phát hànhWalrusQuant
Kho mãsports-analytic-skills
Tên kỹ năngmodel-interpretation
Sao
53
Bản fork
4
Tệp đi kèm
5
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được WalrusQuant công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Model Interpretation trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/WalrusQuant/sports-analytic-skills/tree/main/skills/model-interpretation
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/WalrusQuant/sports-analytic-skills.git /tmp/sports-analytic-skills
mkdir -p .claude/skills
cp -r /tmp/sports-analytic-skills/skills/model-interpretation .claude/skills/model-interpretation
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Model Interpretation trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Model Interpretation ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Model Interpretation với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

The bundled helpers require pandas and NumPy:

bash
python -m pip install pandas numpy

Parquet input also needs pyarrow or fastparquet. Inputs may be CSV, Parquet, JSON, JSONL, or NDJSON.


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.


Standalone Helpers

bash
python /path/to/model-interpretation/scripts/slice_errors.py \
  --input held-out-predictions.csv --slice-cols fold --out slices.json

python /path/to/model-interpretation/scripts/largest_misses.py \
  --input held-out-predictions.csv \
  --columns fold,source_row --top 25

The defaults (y_true, logistic_probability, and the fold slice) match the prediction artifact emitted by predictive-modeling/scripts/run_fold_table.py. Use --actual-col, --prob-col, and --slice-cols for another candidate or schema. Preserve context fields with the predictive helper's --id-cols if you need team, opponent, or home/away slices. The scripts validate binary outcomes and probability bounds. For symmetric team-game artifacts, add --filter-col is_home --filter-value 1 so each event is evaluated once.

These helpers cover probability-error tables only. Coefficient scaling, permutation importance, causal interpretation, margin residuals, and model stability require the external model artifacts and methods described below; the bundled scripts do not compute them.


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

text
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, 2018–2024 walk-forward

  1. Mean log-loss beats constant → proceed
  2. Leakage CLEAN
  3. Slice by season: check if 2020 or one year carries it
  4. Slice home/away: both should beat constant if the model is real
  5. Tails: run calibration-check/scripts/calibration_report.py and inspect bin counts
  6. Largest misses: road dogs that won, or huge favorites that lost
  7. Writeup: “beats constant on most folds; weak on early-season low-sample rows”

Bundled Resources

references/

scripts/

  • slice_errors.py
  • largest_misses.py

Related Skills

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

Quick Command Card

bash
python /path/to/model-interpretation/scripts/slice_errors.py \
  --input held-out-predictions.csv --slice-cols fold --out slices.json

python /path/to/model-interpretation/scripts/largest_misses.py \
  --input held-out-predictions.csv \
  --columns fold,source_row --top 25

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Model Interpretation làm được gì?

Diễn giải mô hình thể thao bằng các dự đoán trên dữ liệu giữ lại, hệ số, phân tích lỗi theo nhóm, những sai lệch lớn nhất, bối cảnh hiệu chuẩn và các bước kiểm tra độ ổn định. Dùng sau khi đánh giá theo thời gian để giải thích những yếu tố chi phối mô hình và những điểm mô hình không xử lý tốt.

Vì sao nên dùng Model Interpretation trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Model Interpretation là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Model Interpretation trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/WalrusQuant/sports-analytic-skills/tree/main/skills/model-interpretation. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Model Interpretation?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Model Interpretation với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Model Interpretation với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Model Interpretation có miễn phí không?

Có. Kỹ năng này được WalrusQuant phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇