技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
elo-engineering【数据与研究】Builds multi-variant Elo rating systems for sports prediction. Use when user asks about Elo ratings, rating systems, team strength, K-factor, home field advantage, season carryover, margin-of-victory adjustments, or mentions 'Fading Elo', 'Form Elo', 'Component Elo'. Do not use for general feature construction -- see feature-engineering instead. Do n…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Default data tool: PuckAPI (
puckapi-tool). Useget_games(5 credits) for historical game results to build and update ratings. Useget_team_stats(5 credits) for goal/score data needed for Component Elo. For your own CSV of game results, skip the tool and work with the file directly.
You are an expert in Elo rating system construction for sports prediction. Your goal is to build, tune, and export multi-variant Elo systems that can serve as model features or standalone win probability estimators. PuckCast uses 5 Elo variants as features -- they rank among the most important predictors in the model.
feature-engineeringteam-analysismodel-buildingplayoff-simulation| Command | What It Does | Credits |
|---|---|---|
get_games | Historical results for building ratings | 5/query |
get_team_stats | Goals for/against for Component Elo | 5/query |
get_standings | Current season context | 2/query |
| Not Available | Use Instead |
|---|---|
get_elo_ratings | Build ratings from get_games results |
get_team_strength | Use get_team_stats + compute Elo |
get_historical_ratings | Rebuild from game logs with carryover |
Before building, establish:
parameter-reference.md)PuckAPI (default): Use get_games with season and league filters. Returns home team, away team, final score, game date.
Your own data: Required columns: game_id, date, home_team, away_team, home_score, away_score. Sort ascending by date before processing. Flag games with missing scores -- do not silently drop.
The baseline. Ratings update after every game based on expected vs actual outcome.
expected_home = 1 / (1 + 10^((away_elo - home_elo - HFA) / 400))
new_home_elo = home_elo + K * MOV_multiplier * (actual - expected_home)
new_away_elo = away_elo + K * MOV_multiplier * ((1 - actual) - (1 - expected_home))
actual = 1 (home win), 0 (away win), 0.5 (tie/OT loss handled by sport)HFA = home field advantage in Elo points (NHL default: 35)Recent performance weighted more heavily via exponential decay. Useful when teams change significantly mid-season (trades, injuries).
weight = exp(-decay_rate * days_since_game)
weighted_K = K * weight
Short-term momentum. Only the last N games (default N=5, test N=7 and N=10) contribute to the rating. Ratings reset to a baseline each calculation.
Process:
Separate offense and defense ratings per team. Offensive rating updates based on goals scored vs expected; defensive rating updates based on goals allowed vs expected.
expected_goals_for = f(home_off_elo, away_def_elo, HFA_goals)
off_update = K_component * (actual_goals_for - expected_goals_for)
def_update = K_component * (actual_goals_against - expected_goals_against)
get_team_stats or score columns from get_gamesStandard Elo with fixed K-factor -- no margin-of-victory adjustment, no adaptation. Simpler and sometimes competitive when training data is limited.
new_elo = elo + K_flat * (actual - expected)
Apply to Standard, Fading, and Component variants. Prevents a 5-0 blowout from updating ratings as much as a 5-0 game when the true gap is extreme.
MOV_multiplier = ln(abs(score_diff) + 1) * (2.2 / (win_elo_diff * 0.001 + 2.2))
score_diff = absolute goal/point differencewin_elo_diff = winner's Elo - loser's Elo before the gameGrid search to minimize log loss on held-out historical data.
Parameters to tune (Standard Elo):
Process:
See parameter-reference.md for published starting points by sport.
At the start of each new season, blend each team's end-of-season rating toward 1500 (league mean). This accounts for roster turnover and regression to the mean.
new_season_elo = carryover * end_elo + (1 - carryover) * 1500
parameter-reference.md for other sports)Expansion teams: Initialize at 1380-1400 (below mean) to reflect unknown quality.
| Rationalization | Why It's Wrong | Do This Instead |
|---|---|---|
| "Initialize all teams at 1000 for simplicity" | Scale doesn't matter, but 1500 is conventional and matches published benchmarks you'll want to compare against | Use 1500. Deviation gains nothing. |
| "Use the same K for all sports" | NHL teams play 82 games; other sports have very different schedules. K must reflect game frequency and score variance. | Use sport-specific defaults in parameter-reference.md. Tune from there. |
| "Skip MOV adjustment to keep it simple" | Without MOV, a 6-1 blowout and a 2-1 win shift ratings identically. Signal is lost. | Implement the logarithmic MOV multiplier. It's 3 lines of code. |
| "One Elo variant is enough" | PuckCast's feature importance shows each variant captures different signal. Standard and Form are often the top two features. | Build all 5. Use feature selection to prune later if needed. |
| "Don't regress ratings between seasons" | A team that went 60-22 in 2023 is not the same team in 2024. Over-confident carry-forward pollutes predictions. | Apply carryover. NHL uses 0.88 -- 12% regression. Other sports regress even more. |
| "Use end-of-season ratings for next season's opening day" | Without regression, teams that had lucky seasons (high PDO) stay overrated. | Apply carryover formula on day 1 of the new season. |
For each variant, produce a ratings table:
team | elo_standard | elo_fading | elo_form | elo_off | elo_def | elo_flat | as_of_date
-------------|-------------|------------|----------|---------|---------|----------|----------
Buffalo Sabres| 1487.3 | 1491.2 | 1502.1 | 1495.6 | 1478.9 | 1489.1 | 2026-05-01
Toronto Leafs | 1534.8 | 1529.4 | 1518.7 | 1541.2 | 1528.3 | 1532.0 | 2026-05-01
For model features: output as one row per game with home/away ratings as of game date.
| What You Found | Next Action | Skill |
|---|---|---|
| Elo variants built, ready to add to model | Combine with other features | feature-engineering |
| Ratings built, want a full model | Train on Elo + other features | model-building |
| Model trained, need to verify calibration | Check probability output quality | probability-calibration |
| Want to simulate playoff bracket | Use Elo to seed simulations | playoff-simulation |
| Elo accuracy unclear | Backtest against market odds | backtesting |