Applying Elo rating to football

February 15, 2024

5 minutes read

If you're a football fan, you might be familiar with the ; if you're a chess fan, you might be familiar with the . If you're a fan of both, you might have wondered what would happen if we applied Elo to football.

A simple internet search will lead you to , where national teams are ranked based on their Elo points.

This post, however, is a step-by-step explanation of how that works, and my attempt at applying the system to real-world data.

But what is Elo?

In a nutshell, the calculates the relative skill level of players in games such as chess. It does so by assigning a numerical rating to each player.

The difference in ratings between two opponents predicts the probability of one player winning against the other, with the higher-rated players expected to win.

Although it's mostly linked to chess, today, Elo is used as a rating system in many other fields, sometimes not even related to sports.

How does it work?

In a traditional football league, the system is pretty straightforward: Teams get 3 points for a win, 1 point for a draw, and no points when they lose.

In Elo, things are different. After every game, the winning team takes points from the losing one.

This rating system is self-correcting; teams will gradually improve or decline relative to the system's predictions until the ratings reflect their true strength.

Real-world application

I applied the algorithm to Kaggle's .

It includes over 45000 matches, and while the dataset is updated quite often, the one I used for this post was last updated on February 10, 2024.

All teams were given an initial rating of 1000.

The full Python code is available on ; feel free to change it as you like.

Now let's see how the system behaves in the real world:

Final thoughts

This has been my attempt at applying Elo to football, check out the code on , and thank you for making it this far.