Model Interpretationのロゴ

Model Interpretation

コミュニティ
WalrusQuant
model-interpretation

保留データでの予測、係数、誤差の内訳、最大の予測誤差、キャリブレーションの状況、安定性チェックを用いてスポーツモデルを解釈します。時間を考慮した評価の後、モデルの要因や失敗する状況を説明する際に使用します。

Add to TypingMind

概要

公開者WalrusQuant
リポジトリsports-analytic-skills
スキル名model-interpretation
スター
53
フォーク
4
同梱ファイル
5
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    WalrusQuantがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Model Interpretation」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/WalrusQuant/sports-analytic-skills/tree/main/skills/model-interpretation
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをその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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでModel Interpretationを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にModel Interpretationを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Model Interpretationは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込む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

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

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Model Interpretation」では何ができますか?

保留データでの予測、係数、誤差の内訳、最大の予測誤差、キャリブレーションの状況、安定性チェックを用いてスポーツモデルを解釈します。時間を考慮した評価の後、モデルの要因や失敗する状況を説明する際に使用します。

TypingMindでModel Interpretationを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Model Interpretationはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにModel Interpretationをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/WalrusQuant/sports-analytic-skills/tree/main/skills/model-interpretationを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Model Interpretationを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Model Interpretationで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもModel Interpretationを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Model Interpretation」は無料ですか?

はい。WalrusQuantがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇