Note
This is a personal project, I am not affiliated with any sports organization or team. The data used in this project is from various public APIs including the Jolpica F1 API for Formula 1. I personally cover the expenses for the server, domain, etc. If you like this project and want to support it, you can buy me a coffee.
A multi-sport ELO rating system to identify the greatest athletes across different sports.
This project calculates ELO ratings for athletes across various sports, inspired by Mr V's Garage and motivated by the desire to quantitatively compare athletes within their respective sports. Initially focused on Formula 1, the system is expanding to include multiple sports such as MotoGP, NBA, football leagues (Serie A, Premier League, La Liga), boxing, and more. Each sport uses a rating calculation method appropriate to its competitive structure, allowing for meaningful comparisons within each discipline.
Note
All rookie athlete in any sport will start with 1000 ELO>
The Jolpica F1 API also retrieves in the first years of F1 Indy 500 races, those races/drivers will be ignored, and the data will be deleted. The reason is that the Indy 500 was part of the F1 championship in the first years, and the drivers were not the same as the regular F1 drivers.
The system employs different calculation methods based on the type of competition:
Standard ELO rating system for direct competition:
Parameters | Description |
---|---|
|
|
|
|
New athlete rating | |
Old athlete rating | |
Multiplier used. Value |
|
Value depending on the result against the rival |
|
Rating winnings or losings for athlete |
Team average ELO is calculated, then applied to update individual player ratings based on match results
Parameters | Description |
---|---|
|
|
|
|
New team rating | |
Old team rating | |
Multiplier used. Value |
|
Value depending on the result against the rival |
|
Rating winnings or losings for team (it will be applied to all the team athletes |
System based in iRating that accounts for position finishing and field strength.
Variable | Description |
---|---|
Driver current iRating before the race | |
Strength of Field, calculated as the average iRating of all drivers in the race | |
Driver final position in the race | |
Number of drivers in the race |
Driver Expected Performance against the
This factor influences how much driver's elo can change in a single race. For motorsports, a typical
Define an Actual Performance Score (
This way, the winner gets
Finally, use the Elo-based adjustment for the elo change:
This
New elo:
Let’s say:
-
Driver initial Elo
$R_{before}$ is 1500. The race$SoF$ is 1600. Driver finish in 5th place out of 20 drivers. -
Expected Finish Probability:
$$E=\cfrac{1}{1+10\cfrac{(1600−1500)}{400}}=\cfrac{1}{1+10\cfrac{100}{400}}≈0.36$$ -
Scaling Factor (
$K$ -Factor):$$K=30+\cfrac{70}{20}=30+3.5=33.5$$ -
Actual Performance Score (
$S$ ):$$S=1−\cfrac{5−1}{20−1}=1−\cfrac{4}{19}≈0.79$$ -
Calculate Elo Change:
$$ΔR=33.5×(0.79−0.36)=33.5×0.43≈14.4$$ -
Updated Elo:
$$R_{after}=1500+14.4=1514.4$$
This approximation captures the essence of elo adjustments in iRacing. The parameters (such as
- ✅ Formula 1
- ⬜ MotoGP
- ⬜ Football Leagues: Starting with major European leagues:
- ⬜ La Liga
- ⬜ Premiere League
- ⬜ Serie A
- ⬜ Basketball (NBA)
- ⬜ UFC
- ⬜ Boxing ... more to come
- ✅ Mechanism to reset and reprocess all the data, been able to reprocess only one rating system. Added in version v2.0.0
- ⬜ Implement in the elo record also information about how much win/lose the driver and against whom.
- ⬜ Blue/Green deployment using Docker Swarm.
- ⬜ Take into account DNS and DNF in the calculation of the rating, mechanical issues should not impact negatively to motorsports.
- ⬜ Create open source libraries to calculate ratings.
This project is licensed under the MIT License with the addition of a "Commons Clause." Below is a brief summary of what this means:
- Permissions: You are free to use, copy, modify, merge, publish, distribute, sublicense, provided that the original copyright notice and this license are included in all copies or substantial portions of the software.
- Restrictions: The "Commons Clause" adds a condition that prohibits selling the software itself. This means you cannot charge fees for products or services whose primary value comes from the functionality of this software. For example, you cannot offer it as a paid hosted service or sell it directly.
- Warranty Disclaimer: The software is provided "as is," without warranty of any kind. The authors are not liable for any damages or issues arising from its use.
For full details, please refer to the LICENSE file.
Elo Rating System
Jolpica F1 API
Mr V's Garage inspiring video
ELO System
iRating System