← Football analyticsPersonal project / Data Science

Defensive pressure and passing outcomes.

A hands-on football data study, using Python and AI to investigate tracking data and test passing outcomes.

My contribution
Hands-on Python foundations, research questions, football context and review; AI-assisted implementation and statistical guidance as complexity increased
Development
Personal portfolio study · November 2026 · first analysis iteration complete
Tools & capabilities
  • Python
  • pandas
  • NumPy
  • Matplotlib
  • scikit-learn
  • Spatio-temporal data
  • AI-assisted development
Real Game 1 corner-kick pass at its recorded start, with player positions and a nearest-opponent distance of 26.78 metres
An illustrative event from real tracking: the opponent nearest to the passer is almost 27 metres away. One example is not evidence of an aggregate relationship.
Real pre-pass player paths and pair separations for three diagnostic events
Follow a fixed player pair before the recorded pass start.
Held-out Game 2 calibration and predicted-probability distributions
Test probability predictions on a second match, with limitations visible.

Source: Metrica Sports public sample data, Games 1 and 2. Figures are actual outputs from this AI-assisted analysis, not synthetic reconstructions. The dashboard includes counts, uncertainty and quality diagnostics.

01 / The problem

The problem

How do opponent proximity and closing movement relate to passing outcomes? I wanted to investigate a football question using real data, while building enough practical understanding to explain the work myself.

I deliberately held back from handing the early Python work over to AI. With guidance, I practised the foundations myself: loading files, filtering events, creating columns and checking what each query returned. As the analysis became more complex, I switched to AI-assisted coding to accelerate production and evaluation.

I brought the football experience and the questions about what the data actually meant. Why was the ball missing? Did a clearance have the same purpose as a pass? Was an opponent getting closer because the defender moved, the passer moved, or both? AI helped turn those questions into checks and code; the applied football judgement remained a human contribution.

02 / The approach

The approach

I started by inspecting event categories and adapting small pandas queries in VS Code. Reading the provider's definitions showed why unsuccessful passes could not simply be counted from PASS rows. I chose to separate clearances by purpose, even where they ended with a teammate.

As complexity increased, AI supplied more of the implementation while I ran the scripts, reviewed the outputs and questioned their football interpretation. The workflow connected events to tracking, converted positions into metres and measured nearby opponents and relative movement during the 0.48 seconds before recorded pass start.

We inspected individual examples, tested whether the patterns changed with team, opponent selection and restarts, then compared simple statistical models. Training used one match; evaluation used a second. The aim was a fair test of whether the extra measurements helped, rather than finding a way to make them appear successful.

03 / Considerations

Considerations

Outcome definitions mattered: provider PASS events were treated as completed passes, while BALL LOST subtypes containing INTERCEPTION supplied a restricted set of unsuccessful attempts. Other failures were not fully identified, so the result is not an overall pass-completion study.

Complete coordinates did not guarantee accurate observations. A headed-pass example showed a ball position roughly 25 metres from the recorded passer and an implausible trajectory jump. We retained separate location diagnostics rather than automatically shifting the event timestamp.

Relative closing includes movement by both players; it is not defender speed. Proximity is an approximation of pressure. Prediction features use information at or before recorded start, without the realised receiver or subsequent ball path. Two matches cannot establish broad generalisability.

04 / The solution

The solution

A reproducible Python workflow and local interactive dashboard. It brings together event classification, tracking-quality checks, release-time proximity features, relative closing, pitch visualisations, descriptive comparisons and a held-out model evaluation.

The dashboard lets a reader choose a pass, inspect the preceding tracking frames, click players and examine pairwise distances. Separate views show the findings, sensitivity checks, model scores, uncertainty and methodological limitations. Saved model probabilities are shown for Game 2 only; moving the time slider does not recalculate them.

The case study, code guide and contribution record explain both what was done and where AI assisted. A 14-stage runner regenerated the previously reported results in the existing environment.

05 / Outcome & learning

Outcome & learning

The extra proximity and movement features did not clearly improve probability predictions over a simpler model based on pitch location. They slightly improved the ordering of attempts by risk, but did not make the predicted probabilities better overall. That was a useful finding to keep, rather than something to hide or keep adjusting until it looked positive.

The project has also been a way to learn on the job and revisit the mathematical and statistical foundations of my Physics with Computing degree. Some methods were new to me; others brought familiar ideas back into focus. Working through a football question helped me understand their purpose: start with a sensible baseline, test on data the model has not learned from, and acknowledge uncertainty.

I am developing that understanding, not presenting myself as a statistical modelling expert. The dashboard keeps the detailed results available to inspect, while the main takeaway is straightforward: these particular pressure proxies did not demonstrate better probability prediction in this small two-match study. That does not mean pressure is unimportant in football.

06 / Why it matters to me

Why it matters to me

The distinction between producing code and understanding the work matters to me. I wanted to practise the basics before using AI to move faster, then keep questioning the output as the implementation became more involved. My football experience helped make those questions concrete.

AI was an implementation and learning partner, supplying substantial code, explanations and statistical guidance. I set the direction, made classification decisions, ran and inspected the work, and challenged the meaning of the data. I am still building the ability to explain and modify all of the later code independently. Having the working analysis to revisit makes that learning practical.

Next project: The Haaland Paradox ↗
Let's connect

Let’s start a
conversation.

Connect about analytics, strategy and considered creative work.

Connect on LinkedIn ↗