Zum Inhalt springen

Calculating the Win Probabilities of Premier League Teams(2024)

By Cheptoo Faith

This analysis estimated the win probabilities of the Premier League teams using actual match data obtained from football-data.org. The article breaks down the step-by-step process of how the probabilities were obtained.
Step 1: Gathering the Match Data
This began by collecting real-time and historical data from the Football-Data.org API (https://api.football-data.org/v4/competitions/PL/matches?season=2024), which provides detailed stats for every Premier League match. Using Python and the requests library, I sent a request to the API and retrieved data, including match status, team names, and final scores. This gave me the raw data needed for analysis.

Step 1 Python code

Step 2: Structuring the Data
After retrieving the match data, I used the pandas library to organize it into a structured DataFrame. I extracted key details from each match, including status, home and away teams, and final scores. These were stored in a list of dictionaries and then converted into a DataFrame for easier analysis and manipulation.

Step 2 Python code

Step 3: Calculating Win Probabilities
In this step, I calculated the win probability for each Premier League team based on the 2024 match data. For every team, I counted the number of matches they won both at home and away, then divided the total number of wins by the total number of games they played. The results were stored in a dictionary and converted into a DataFrame, sorted from the highest to the lowest win probability.
Win Probability Formula
Win Probability = (Total Wins/Total Games Played)

Step 3

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert