ANALYTICS MADE EASY

The Power of Football Expected Goals

In the palm of your hand

octosport.io
8 min readJun 10, 2024

Introduction

Have you ever watched a dominant team lose despite creating numerous scoring opportunities? Or witnessed a team win with a seemingly lucky goal? Traditional sports analysis often focuses on the final score, failing to capture the full story of a match. This is where Expected Goals (xG) steps in, offering a revolutionary approach to understanding team and player performance.

xG goes beyond the simple act of scoring a goal. It’s a metric that analyzes the quality of scoring chances, accounting for factors like shot location, angle, and type of attempt. By analyzing a multitude of shots over multiple games, xG reveals a team’s true goal-scoring potential, often presenting a clearer picture than the final score itself.

However, accessing powerful and accurate xG models has traditionally been a hurdle. Expensive costs and complex implementation could leave many fans and analysts on the sidelines. But what if there was a way to unlock the insights of xG without breaking the bank?

This article delves into the innovative Octosport xG model, a solution designed to democratize the power of xG analysis. Combining exceptional accuracy (backed by state-of-the-art research) with cost-effective API access through Sportmonk, the Octosport model empowers anyone to leverage the power of xG. Let’s dive in!

How is xG calculated?

There are various xG models, but they all use a similar approach. First, the model is trained on a large dataset of historical shots, along with the outcome of each shot (goal or no goal). The model then learns to identify the factors that are most important in predicting the outcome of a shot.

An expected goal model should take only the same information as the player has just before the shot is taken.

Once the model is trained, it can be used to calculate the xG of any new shot. To do this, the model simply inputs the relevant information about the shot and outputs a probability of scoring between 0 and 1. Here is a list of the most common information used in the model:

  • Distance from goal: Shots from closer to goal are more likely to result in a goal than shots from further away. This is because the goalkeeper has less time to react to close-range shots.
  • Angle to goal: Shots from a narrower angle are more likely to result in a goal than shots from a wider angle. This is because the goalkeeper has less space to cover when the shot is from a narrower angle.
  • Assist type: Shots from through balls are more likely to result in a goal than shots from crosses. Through balls offer a higher chance of scoring as they put the attacker in a one-on-one situation with the goalkeeper. Crosses, requiring the attacker to control the ball in the air for a header or volley, are generally tougher to convert into goals.
  • Team tactics: Some xG models also take into account team tactics, such as the number of defenders in the box and the position of the goalkeeper. Teams that attack with more players in the box are more likely to create scoring opportunities, and teams with a well-positioned goalkeeper are more likely to prevent goals from being scored.

Different xG models apply varying weights to each factor, but the basic approach remains the same: using historical data to identify the factors most important in predicting the outcome of a shot. The higher the xG value, the more likely the scoring opportunity is to result in a goal.

The xG of a shot represents the probability that the shot will result in a goal.

Expected goals can be summed up at the player or team level for a given game to give the respective player and team xG. It is important to note that xG is not a perfect metric. It is based on historical data, and it cannot account for all of the factors that can affect the outcome of a shot. However, xG is a precious tool for evaluating player and team performance, and for developing better match strategies.

How to use xG?

Expected goals can be used in a variety of ways to improve sports analysis. Indeed comparing xG to actual goals can help you to identify players and teams who are overperforming or underperforming.

  • Evaluating player performance: xG can be used to evaluate player performance by comparing a player’s actual goals to their expected goals. For example, if a player has scored 10 goals but their xG is only 8, then this suggests that the player has overperformed their expected goals. This could be due to a variety of factors, such as good finishing skills, lucky breaks, or poor goalkeeping by the opposition. On the other hand, if a player has scored 5 goals but their xG is 10, then this suggests that the player has underperformed their expected goals. This could be due to a variety of factors, such as poor finishing skill, unlucky misses, or good goalkeeping by the opposition.
  • Evaluating team performance: xG can also be used to evaluate team performance by comparing a team’s actual goals to their expected goals. The same analysis as at the player level can be done.
  • Making betting decisions: xG can also be used to make more informed betting decisions. For example, if a team has a high xG in a match, then they are more likely to win or draw the match. This information can be used to inform betting decisions.

Expected goals can also be a decision-making tool for coaches. For example, you can track a player’s xG over time to see if they are improving or declining. You can also track a team’s xG over time to see if they are becoming more or less creative. You can use xG to identify the best areas of the pitch to create scoring opportunities. You can also use xG to identify the best ways to defend against scoring opportunities.

Expected goals also provide media with valuable insights, enriching the fan experience by offering deeper analysis beyond just the final score.

How to interpret xG

When you first read about expected goals you must be confused about few things. For instance, why is the player quality not taken into account? For the same shot location and team position a good striker has more chance to score than an average player. In fact, by only taking the shot properties, the xG of the player will give you an idea of how good the player is compared to other players all things being equal.

A player exceeding their xG suggests they are in good finishing form or possess exceptional talent.

Another example is multiple shots in the sample action. Imagine a team takes 3 shots in the action, each with a 0.5 chance of scoring (meaning 50% likely to go in). Using xG, these shots would contribute a total of 3 x 0.5 = 1.5 expected goals. Now, in reality, the team might only score 1 goal from those 3 attempts. This difference between the 1.5 expected goals (xG) and the 1 actual goal scored highlights the team’s inefficiency in converting those chances. The beauty of xG is that it considers these situations over a larger sample size. By looking at a team’s xG across many games, we can see if they consistently underperform their expected goals, suggesting potential finishing issues.

A team that scores less goals than its xG shows that the team may be struggling with finishing skills.

Octosport xG model performance

In collaboration with Sportmonks.com, Octosport has launched a cost-effective and highly accurate xG model. We won’t go into much detail about the model but we want to present the results and comparison against what has been already published in academic research.

The metric we will use for evaluating the performance of the model is the log-loss.

The log-loss measures the quality of the scoring probabilities outputted by the model. The closer to zero the better the model.

Even if we do not compare the models on the same shot, as long as the number of shots is large, the log-loss is relevant to rank the different approaches. Several researchers have published their log-loss during the past years.

For instance, Rogier Noordman got a log-loss of 0.2787. Sachin Narayanan and N. David Pifer found 0.2793 for men and 0.2935 for women while James Mead found 0.28184.

Octosport model leverages a massive dataset of over 150,000 historical shots (training set) trained before August 2023 and keeps expanding it. This extensive training ensures the model accurately captures the nuances of scoring opportunities.

To validate its effectiveness, the model’s performance was rigorously tested on a separate dataset of 110,000 shots collected after August 2023 (test set). On this test set, the log-loss of our model is 0.2718 placing the Octosport model among the industry’s best research-backed expected goals models.

Beyond xG

From xG, we can derive several specific metrics that enhance our understanding of different aspects of the game. All these metrics are calculated and provided through Sportmonks API.

  • xG On Target (xGOT) Measures the probability of an on-target shot resulting in a goal. Shots aimed at the corners are generally more likely to score than those aimed at the middle. An xGOT of 0 means the shot is expected never to score, while an xGOT of 1 means it is expected to score every time. xGOT is a post-shot model, unlike xG, which is a pre-shot model.
  • Non-Penalty xG (npxG) Calculates expected goals excluding penalties, showing a team’s or player’s ability to create open-play chances. Other set plays like corners and free kicks are still included.
  • xG Open Play (xGOP) Measures expected goals excluding all set pieces, assessing a team’s ability to create scoring chances during open play.
  • xG Set Play (xGSP) Measures expected goals from set pieces, such as corners, free kicks, and penalties, highlighting a team’s effectiveness in dead-ball situations.
  • xG Corners Evaluates expected goals from corner kicks, providing insights into a team’s strategy and effectiveness in converting these chances.
  • xG Free kick Calculates expected goals from direct free kicks, assessing the likelihood of scoring from set pieces outside the penalty area.
  • xG Penalty Measures expected goals from penalty kicks, with each penalty worth 0.79 xG.
  • Shooting Performance (SP) Assesses shooting quality by comparing xGOT (expected goals on target) to xG. A higher xGOT than xG indicates better shooting performance.
  • Expected Points (xPTS) Estimates the points a team should earn based on xG for and against, providing a measure of performance beyond actual match results.
  • xG Against (xGA) Calculates expected goals a team is likely to concede, providing insights into defensive performance.
  • Expected Goal Difference (xGD) Measures the difference between a team’s xG for and against, indicating the balance between attacking and defensive performances.

Conclusion

Expected goals (xG) have revolutionized sports analysis, providing a deeper lens into player performance, team strategies, and even predictive insights. By analyzing scoring opportunities across multiple games, xG unveils a team’s true scoring potential compared to actual goals, offering invaluable information beyond the final score.

However, building and maintaining accurate xG models traditionally required vast data acquisition, advanced statistical analysis, and machine learning expertise — factors contributing to expensive xG access for many.

This collaboration between Sportmonks and octosport tackles these limitations by offering a best-in-class solution. The Octosport model, meticulously trained on a massive dataset of over 150,000 shots, delivers exceptional accuracy with a log-loss of 0.2718. This level of performance positions it among the industry’s top research-backed models.

Through Sportmonks’ user-friendly API, this powerful xG analysis becomes accessible and cost-effective. This empowers a wider range of users to leverage the insights of xG and beyond and gain a deeper understanding of the beautiful game.

--

--

octosport.io
octosport.io

Written by octosport.io

I am a data scientist writing about machine learning for football prediction at octosport.io.

Responses (1)