algo-rank-elo

Solid

"Implement Elo rating system to rank items or players from pairwise comparison outcomes. Use this skill when the user needs to rank items from head-to-head matchups, build a competitive rating system, or evaluate relative quality from comparison data — even if they say 'player rating', 'ranking from comparisons', or 'competitive scoring system'.".

AI & Automation 22 stars 8 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
45
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Elo Rating System ## Overview Elo assigns numerical ratings that update after each pairwise comparison. Winner gains points, loser loses points. The amount exchanged depends on expected vs actual outcome. Originally for chess, now used for sports, games, and A/B preference testing. Update runs in O(1) per match. ## When to Use **Trigger conditions:** - Ranking items from pairwise comparison data (A vs B outcomes) - Building competitive rating systems for games or sports - Crowdsourced quality evaluation through pairwise preferences **When NOT to use:** - When you have absolute scores, not pairwise comparisons (use direct ranking) - When team dynamics matter more than individual skill (use TrueSkill) ## Algorithm ``` IRON LAW: Elo Assumes Each Matchup Is Independent and Stationary Rating changes are based on surprise: beating a higher-rated opponent gains more points than beating a lower-rated one. K-factor controls update speed: high K (32) = volatile, fast adaptation. Low K (16) = stable, slow adaptation. Choose K based on how quickly skill changes. ``` ### Phase 1: Input Validation Initialize all participants at base rating (typically 1500). Collect match results: winner, loser (or draw). **Gate:** Valid match data, no self-matches. ### Phase 2: Core Algorithm 1. Expected score: E_A = 1 / (1 + 10^((R_B - R_A)/400)) 2. Actual score: S_A = 1 (win), 0.5 (draw), 0 (loss) 3. Update: R_A_new = R_A + K × (S_A - E_A) 4. Process all matches sequentially (order matters for...

Details

Author
charlieviettq
Repository
charlieviettq/awesome-agent-skill
Created
2 months ago
Last Updated
6 days ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category