My Signals
✦ SportSignals+ just now
Value SmartBetsNEW Props Predictions Live My Bets Alerts

How xG Models Are Calculated: Data, Labels and Calibration

Fact-checkedPublished Updated 4 min readGuide 20 of 26

Latest review: Rebuilt the page around shot labels, features, availability, provider definitions, calibration, and the boundary between xG measurement and match forecasting.

Current

The supporting evidence is within its scheduled review window.

Evidence checked
Review due
In this article (11 sections)

In short

An expected-goals model treats each eligible shot as an observation and estimates its scoring probability from information available at the shot. Training labels come from whether comparable historical shots became goals. Provider features and modelling choices differ, so xG values are model-specific.

SportSignals illustration: AI football data network for How xG Models Are Calculated
SportSignals illustration
Key Takeaways
  • State which events count as shots and how penalties, own goals, blocked attempts, shoot-outs and missing coordinates are handled.
  • StatsBomb's open-data repository exposes one inspectable event structure and selected contextual data.
  • Logistic regression, boosted trees and neural models can all estimate shot probability.
  • Calibration guidance explains probability reliability.

Define the shot sample

State which events count as shots and how penalties, own goals, blocked attempts, shoot-outs and missing coordinates are handled. Opta's xG explanation describes one provider model and example inputs; other providers can make different choices.

Build the training row

Field family Examples Leakage check
Geometry Distance, angle, location Use coordinates available at shot time
Technique Body part, set play, assist type Apply one provider vocabulary
Sequence Cross, through ball, rebound Do not use later sequence outcome
Context Defender or goalkeeper positions Record tracking or freeze-frame coverage
Label Goal or no goal Exclude post-shot information from pre-shot xG

StatsBomb's open-data repository exposes one inspectable event structure and selected contextual data. Open access does not make provider definitions interchangeable.

Fit a probability model

Logistic regression, boosted trees and neural models can all estimate shot probability. Use a simple geometric baseline first. Fit preprocessing inside training data, preserve feature definitions, and version the model. scikit-learn's common-pitfalls guide documents inconsistent preprocessing and leakage risks.

Worked interpretation

Suppose a model assigns three shots 0.08, 0.22 and 0.45. Their match xG sum is 0.08 + 0.22 + 0.45 = 0.75. That total is the sum of estimated shot probabilities. It is not the probability of at least one goal and does not say the team should have scored exactly 0.75 goals.

Validation

  1. Split chronologically or by later competitions.
  2. Compare with a simple distance-angle baseline.
  3. Report log loss or Brier score and sample size.
  4. Plot calibration by probability band.
  5. Inspect penalties, headers, rebounds and rare high-value shots.
  6. Test provider or model-version drift separately. Calibration guidance supports the probability-band check, and football benchmark research supports controlled feature and model comparisons.

Calibration guidance explains probability reliability. Football benchmark research supports controlled feature and model comparisons.

Keep the intents separate

Use xG explained to interpret an xG value and xG research workflow to test lagged xG features for future prediction. This page owns model construction.

Define the training label without ambiguity

The usual shot-level target is whether the recorded attempt became a goal under the provider's event rules. Decide how to handle penalties, own goals, blocked shots, rebounds, shoot-outs and missing coordinates before fitting. A provider's definition and data corrections are part of the model contract.

Audit Reader-facing question
Label exclusions Which attempts can enter the model?
Location quality Are coordinates complete and consistently oriented?
Body part and assist type Which categories exist and how are unknowns handled?
Competition coverage Where was the model trained and tested?
Version boundary Can historical values change after a model update?

Opta's xG explainer provides one established provider description of model inputs. It supports provider-specific interpretation, not a universal feature list.

Test transfer and drift

Train on earlier shots and test on later competitions or seasons without letting later encodings affect the earlier pipeline. Report calibration and score by shot type, league and model version. A model can be well calibrated overall while overstating headers or understating penalties.

When the provider changes event collection or the xG implementation, retain the version boundary. Recalculating an archive can improve consistency for description, but a prediction backtest must still reproduce the values available at each historical cutoff. scikit-learn's common-pitfalls guidance supports keeping later information and changed transformations out of historical evaluation states.

Continue learning

Assumptions and limitations

The three-shot example is illustrative. Event data can omit goalkeeper, defender and off-ball context. Calibration can change by competition, provider and time, so versioned future-sample testing remains necessary.

Was this article helpful?
Sources and evidence5 sources, checked 14 Jul 2026
  1. What Is Expected Goals (xG)? (Opta Analyst)Supports: How an established data provider defines and constructs expected-goals estimates. Accessed 13 Jul 2026.
  2. StatsBomb Open Data (StatsBomb)Supports: First-party open football event, lineup, match, and selected 360 data, including documented file structure and licence conditions. Accessed 14 Jul 2026.
  3. Probability calibration (scikit-learn)Supports: Calibration of probabilistic classifiers and interpretation of forecast probabilities. Accessed 13 Jul 2026.
  4. Common pitfalls and recommended practices (scikit-learn)Supports: First-party guidance on leakage, inconsistent preprocessing, randomness, and reproducible evaluation. Accessed 14 Jul 2026.
  5. Evaluating soccer match prediction models: a deep learning approach and feature optimization for gradient-boosted trees (Machine Learning)Supports: Peer-reviewed football benchmark design, model comparison, feature selection, and evaluation limits. Accessed 14 Jul 2026.

David Adams

Sports Analyst at SportSignals

David writes every guide in this library, checks it against current operator rules and the named statistical sources, and records what changed in each update. The same byline runs on SportSignals News.

More from AI Football PredictionsEditorial standards

18+

Gambling involves risk. Never bet more than you can afford to lose. If you feel gambling is affecting your life, free and confidential support is available.