Logo Ratings Strength Models

Ratings Strength Models

Cộng đồng
WalrusQuant
ratings-strength-models

Xây dựng và đánh giá mô hình sức mạnh thể thao, bao gồm xếp hạng Elo tuần tự, tách biệt tấn công/phòng thủ, xếp hạng sức mạnh và các đặc trưng đối đầu nghiêm ngặt được tạo trước sự kiện. Dùng để xếp hạng, điều chỉnh theo đối thủ và tạo mô hình cơ sở dự đoán vững chắc.

Add to TypingMind

Tổng quan

Nhà phát hànhWalrusQuant
Kho mãsports-analytic-skills
Tên kỹ năngratings-strength-models
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 Ratings Strength Models 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/ratings-strength-models
  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/ratings-strength-models .claude/skills/ratings-strength-models
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 Ratings Strength Models 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 Ratings Strength Models 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 Ratings Strength Models 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.

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

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 Ratings Strength Models làm được gì?

Xây dựng và đánh giá mô hình sức mạnh thể thao, bao gồm xếp hạng Elo tuần tự, tách biệt tấn công/phòng thủ, xếp hạng sức mạnh và các đặc trưng đối đầu nghiêm ngặt được tạo trước sự kiện. Dùng để xếp hạng, điều chỉnh theo đối thủ và tạo mô hình cơ sở dự đoán vững chắc.

Vì sao nên dùng Ratings Strength Models 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. Ratings Strength Models 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 Ratings Strength Models 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/ratings-strength-models. 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 Ratings Strength Models?

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 Ratings Strength Models 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 Ratings Strength Models 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 Ratings Strength Models 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 👇