Ratings Strength Modelsのロゴ

Ratings Strength Models

コミュニティ
WalrusQuant
ratings-strength-models

連続的なEloレーティング、攻撃・守備別の分割、パワーレーティング、イベント前の情報に厳密に限定した対戦特徴量など、スポーツの強さを測るモデルを構築して評価します。ランキング、対戦相手の強さの補正、強力な予測ベースラインの作成に使用します。

Add to TypingMind

概要

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

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

  • どのLLMでも利用可能

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

  • 5個の同梱ファイル

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

  • オープンソース

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

インストール

AIスキル「Ratings Strength Models」を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/ratings-strength-models
  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/ratings-strength-models .claude/skills/ratings-strength-models
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Ratings & Strength Models (Sports)

Overview

Estimate latent team (or player) strength from past results, then use those ratings only as they existed before game T.

Ratings are often the strongest simple sports baselines and strong features for logistic/ML models. The non-negotiable rule: as-of only.

Bundled standalone path:

  • standalone sequential rating construction
  • held-out evaluation against simple baselines

When to Use This Skill

Use when:

  • Team power ratings / rankings over a season
  • Matchup priors for win or margin models
  • Opponent adjustment
  • Strong baselines before feature-heavy ML
  • User says “Elo,” “power ratings,” or “team strength”
  • NFL/NBA/MLB Elo baselines

Do not use as a substitute for:

NeedGo to
Raw form windows onlytime-series-sports / feature-rules
Full ML horse racepredictive-modeling
Validation designvalidation-design
Season win distributions from ratingssimulation-sports

Installation

The standalone Elo builder and evaluator require pandas:

bash
python -m pip install pandas

Parquet input also needs pyarrow or fastparquet.


Workflow

  1. Choose the result signal (win, margin, goal diff, points ratio, EPA, runs).
  2. Choose update style (sequential Elo-like vs batch season-to-date).
  3. Fit/update using only past games.
  4. Export an as-of rating for each team before each game.
  5. Predict matchups from rating differentials (+ home).
  6. Evaluate with season walk-forward (validation-design).
  7. Compare to constant / home / form baselines (baseline-models).
  8. Report params, as-of rule, metrics, limits.
  9. Optional: feed into simulation-sports.

Model Families

FamilyBest forNotes
Elo / Glicko-stylesequential win strengtheasy as-of; margin optional
Offense/defense splitscore modelsattack vs defense ratings
Least-squares power ratingsseason-to-date marginssolve system each week
Hierarchical strengthplayers with uneven npartial pooling
Possession modelspace sportssport-specific later

Start with Elo-like or margin power ratings before exotic variants.

The bundled scripts implement only the sequential Elo row builder and its score table. Glicko, offense/defense, least-squares, hierarchical, margin, and possession models are methodology in this skill and require separate code.

Read rating_families.md when choosing Elo, power ratings, or an offense/defense model. Read parameters.md before setting update, home-advantage, carryover, or margin rules. Read evaluation.md before designing forward scoring and baseline comparisons.


Standalone Elo Builder and Evaluator

The builder reads a user-owned CSV, Parquet, JSON, JSONL, or NDJSON table with one row per completed game. Defaults require season, game_date, unique game_id, home_team, away_team, home_score, and away_score; all names are configurable.

bash
python /path/to/ratings-strength-models/scripts/elo_asof.py \
  --input games.csv --out elo_asof.csv --k 20 --home-adv 65

python /path/to/ratings-strength-models/scripts/eval_elo_baseline.py \
  --input elo_asof.csv

The builder saves both teams' pre-event ratings before updating either one. Its two-row-per-game output includes team, opponent, is_home, elo_pre, raw rating_diff, home-adjusted elo_diff, win_probability, and actual. Ties receive 0.5.

The order field must strictly order each team's events. If calendar dates can tie, use kickoff timestamps or a verified event sequence. The evaluator scores home rows once per game and reports season-level Elo log loss, Brier score, accuracy, a fixed 0.5 reference, and—after the first season—a home-win-rate reference estimated only from prior seasons. Pass a matched legal baseline with --baseline-prob-col to score it on the same rows. This is a score table for already-built as-of probabilities, not a full walk-forward parameter-tuning pipeline.


Design Choices

K factor

  • Higher K: reacts faster, noisier
  • Lower K: stabler, slower to adapt
  • NFL/NBA starting point: K ≈ 20 on 1500-scale Elo
  • Long-season competitions often justify a lower starting K

Home advantage

  • Add home_adv to home team pre-game Elo when computing expected score
  • Start fixed; estimate later from data if needed

Margin

  • Optional multiplier on K using point differential
  • Diminishing returns (log/sqrt) to avoid blowout domination

Mean reversion / season regression

  • Regress ratings toward mean between seasons for multi-year series
  • Important for long panels and roster turnover

Initialization

  • Common: all teams 1500
  • Report init explicitly

Other Families (patterns)

Least-squares power ratings (season-to-date)

Each week, solve team strengths from margins-to-date; store as-of ratings before each game. Recompute weekly — never use end-of-season solution for early weeks.

Offense/defense split

Each team has attack and defense parameters; predict score lines, not only winners. Still as-of only.

Hierarchical player strength

Partial pooling when player n is uneven (statistical-modeling mixed models / Bayesian refs).


Evaluation

Primary

  • walk-forward log-loss / Brier for win probability from rating diff
  • MAE for predicted margin if modeling spreads

Always compare to in the full methodology

  • constant baseline
  • home-only model
  • form logistic baseline when available

The bundled evaluator implements the 0.5 and prior-season home-rate references plus an optional supplied probability baseline. Constructing home-only logistic, form, or alternative-rating predictions requires baseline-models or another fold-local workflow before calling the evaluator.

Success

  • beats constant on most folds
  • preferably competitive with form logistic

Hard Constraints

  1. As-of only — never use post-game rating to predict that game.
  2. Update order must follow real chronology.
  3. Do not fit K on the final test season repeatedly without nested validation.
  4. Report initialization and scale (e.g. mean 1500).
  5. Do not treat ratings as causal player quality without more structure.
  6. Every rating claim must name sport, seasons, event ordering, and parameters.

Anti-Patterns

  • Final rating applied backward to early games
  • Huge K chasing noise
  • Ignoring home advantage
  • Mixing playoffs and regular season without a flag
  • Claiming ranking quality without forward prediction metrics
  • Using form and Elo interchangeably without a bakeoff

Reporting Template

text
Rating model: Elo
Sport:
Signal: win (margin multiplier: …)
Params: K=…, home_adv=…, init=1500
As-of rule: pre-game rating before update
Validation: season walk-forward
Metrics vs constant / home / form logistic: …
Calibration:
Limits: no roster continuity, no injuries, …
Reproduce: python /path/to/ratings-strength-models/scripts/elo_asof.py --input …

Output Contract

Done means:

  • As-of rule stated
  • Params stated
  • Walk-forward metrics vs baselines present
  • Limits stated
  • Repro command present

Worked Examples

bash
python /path/to/ratings-strength-models/scripts/elo_asof.py \
  --input games.csv --out elo_asof.csv --k 20 --home-adv 65

python /path/to/ratings-strength-models/scripts/eval_elo_baseline.py \
  --input elo_asof.csv

For season simulation, pass a documented pre-event probability artifact to simulation-sports; do not treat final ratings as if they existed before earlier games.


Bundled Resources

references/

FileContents
rating_families.mdfamily overview
parameters.mdK, home_adv, margin, regression
evaluation.mdhow to score ratings

scripts/

FileContents
elo_asof.pybuild pre-game Elo table
eval_elo_baseline.pyscore pre-event Elo probabilities against 0.5, prior-season home rate, and an optional supplied baseline

Related Skills

NeedSkill
Baselinesbaseline-models
Featuresfeature-rules
Form windowstime-series-sports
Predictive MLpredictive-modeling
Validationvalidation-design
Simulation from ratingssimulation-sports

Quick Command Card

bash
python /path/to/ratings-strength-models/scripts/elo_asof.py \
  --input games.csv --out elo_asof.csv --k 20 --home-adv 65

python /path/to/ratings-strength-models/scripts/eval_elo_baseline.py \
  --input elo_asof.csv

同梱ファイル

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

よくある質問

AIスキル「Ratings Strength Models」では何ができますか?

連続的なEloレーティング、攻撃・守備別の分割、パワーレーティング、イベント前の情報に厳密に限定した対戦特徴量など、スポーツの強さを測るモデルを構築して評価します。ランキング、対戦相手の強さの補正、強力な予測ベースラインの作成に使用します。

TypingMindでRatings Strength Modelsを使うメリットは何ですか?

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

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

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

Ratings Strength Modelsを使えるAIモデルはどれですか?

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

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

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

AIスキル「Ratings Strength Models」は無料ですか?

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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