Introduction
Football fans are constantly asking: “What are the odds of my team winning the next match?” While match outcomes depend on a mix of unpredictable factors — player form, strategy, injuries — we can still make meaningful estimations based on historical data.
In this article, I share how I calculated the win probabilities of all Premier League teams in the 2024 season using binomial probability. The data was sourced from the Football Data API and processed with Python.
Pulling Real-Time Standings from the Football Data API
To start off, I connected to the Football Data API and fetched the current standings for the Premier League 2024 season. The response included each team's number of games played, wins, losses, draws, goal differences, and total points. After validating the API response, I extracted the standings and prepared them for analysis.
Structuring the Data for Analysis
Once the data was retrieved, I organized it into a structured table format using a DataFrame. This table included each team’s position, name, games played, wins, draws, losses, points, and goal difference — a clear snapshot of their performance up to that point in the season.
Understanding Binomial Probability
To estimate the probability of a team winning games based on its current form, I used the binomial probability formula.
In statistics, binomial probability helps calculate the likelihood of getting a fixed number of successful outcomes (wins) in a series of independent trials (matches), assuming each trial has the same probability of success.
For this case:
- The number of trials was the number of games played.
- A success was defined as a win.
- The probability of success in a single trial was estimated by dividing wins by games played.
This method assumes every match is an independent and identical trial — a simplification, but still a useful analytical lens.
Calculating Win Probabilities
After computing the binomial probability for each team, I added a new column to my table called “Win Probability.” This value tells us how statistically likely a team’s number of wins is, given its performance rate.
For example, if a team had won 18 out of 30 games, the binomial probability calculation estimates how likely it is for that to happen by chance, assuming a consistent win rate throughout.
In some rare cases, the calculation results in extremely small numbers or causes computational overflows. In such cases, the win probability was set to zero for safety.
Output and Next Steps
I saved the final table — now including win probabilities — as a CSV file. This allowed for easy sharing, visualization, and further analysis using tools like Power BI or Excel.
The final dataset included:
- Team Name
- Position
- Games Played
- Wins, Draws, Losses
- Points
- Goal Difference
- Win Probability
Limitations
Of course, this model is not perfect. It makes a few major assumptions:
- Every game is independent and identical in difficulty.
- It ignores external factors such as injuries, transfers, and fixture difficulty.
- It does not consider home/away advantage or goal margins.
Still, the method offers a data-informed view of team performance, helping to separate consistency from chance.
Future Improvements
To build on this analysis, I’m considering:
- Visualizing the probabilities with charts and graphs.
- Comparing actual results to expected goals (xG) metrics.
- Using a Bayesian model to factor in uncertainty and prior performance.
- Adding match-level data to simulate upcoming fixtures.
Final Thoughts
Combining live sports data with statistical tools like binomial probability opens up fascinating ways to analyze team performance. While no model can predict the beautiful game with complete accuracy, they do bring clarity and context to team success.
If you're interested in football analytics, this is just the tip of the iceberg. Try applying similar methods to other leagues, historical seasons, or even player-level stats.
Follow Along
I’ve published the full code and dataset on my GitHub for those who want to explore or fork the project:
GitHub: [https://github.com/ododaspov/EPL_Predictions/tree/main]
Thanks for reading — and may your favorite team always defy the odds!
Top comments (0)