Inspiration

It started with something Leon's coach used to say: if the midfielder is strong and distributing the ball well, the team is far more likely to win. It's the kind of claim every football fan has heard a hundred times, repeated so often it's treated as fact. We wanted to know if it actually held up against real data — not vibes, not commentary-booth wisdom, but 64 World Cup matches and a full league season of event-level tracking.

What it does

Middlefielder takes StatsBomb's open event data and tests, one layer at a time, what coaches believe about how football is actually won:

  • Which formations actually win more often (4-2-3-1 led the 2022 World Cup at 53.1%; 3-5-2 went winless in 11 matches)
  • Whether midfielders' on-ball passing progression and off-ball defensive positioning differ between wins, draws, and losses
  • Where the ball actually flows through midfield — who midfielders pass to, and who passes to them
  • Whether substitution timing changes anything real, or just reflects a team that was already losing
  • And, critically, whether any of it can predict a match before kickoff — tested properly, with time-ordered validation so nothing from the future leaks into the past

Everything lands in one interactive dashboard, built like a tactics board rather than a spreadsheet, so a coach or a judge with zero stats background can read it in five minutes.

How we built it

We pulled event-by-event data via statsbombpy — 64 matches from the 2022 World Cup for the descriptive layers, then a full 380-match La Liga season for the predictive layer, since genuine prediction needs enough prior matches per team to build rolling form. Every pass, pressure, tackle, and substitution got tagged with pitch coordinates, player position, and match outcome, then aggregated into position-group and player-level metrics: progressive-pass share, defensive-action share, pass dispersion by recipient group, and a composite midfield index combining all of it. The predictive layer used logistic regression on rolling 5-match averages, trained on the first 70% of the season and tested on the final 30%, so the model never saw the future while learning the past.

You're right — it reads like an excuse. Let me cut the clock-watching language entirely and frame it as what it actually is: a specific technical gap you identified, not a time complaint.

Challenges we ran into

The biggest one was self-inflicted. Our first composite "midfield index" rewarded teams for making more substitutions while losing, as a proxy for in-game resilience. It looked reasonable until we noticed losing teams were scoring higher on the index than winning teams — a red flag. The problem was circular logic: a team can only sub while losing if it was already losing, so the metric was measuring the situation, not the skill. We rebuilt it using actual goal-rate improvement after those subs instead of the raw count, and the ordering fixed itself (wins: 51.5, losses: 49.9, draws: 49.4).

The second challenge is one we identified rather than solved: our current predictive method tests whether existing midfield metrics predict outcomes, but it doesn't yet mine the event data for the deeper structural patterns that would make a stronger predictor — passing-sequence signatures, pressing triggers, buildup shape recognition. That's a specific, named next step rather than a vague shortfall: we know exactly which features are missing and why they'd matter, which is what let us scope "What's next" concretely instead of leaving it open-ended.

What we learned

That a metric can be directionally correct and still not be a predictor — descriptive power and predictive power are genuinely different things, and conflating them is probably the single most common mistake in amateur sports analytics. Catching the circularity bug taught us to test every new metric against a null hypothesis as soon as it's built, not after the whole pipeline is assembled — that discipline is now baked into how we'd approach the next metric, not just a lesson we noted in hindsight.

We also learned, very concretely, that the "midfielder as link" role is real but asymmetric: midfielders talk to the back line far more than they launch attacks directly (51.7% of their passes go backward, only 18.9% forward) — which quietly contradicts the mental image most fans have of a midfielder as primarily an attacking conduit.

What's next for Middlefielder

  • Engineer dedicated predictive features from football patterns — passing-sequence signatures, pressing triggers, buildup shape recognition — rather than repurposing descriptive metrics as predictors
  • Pool multiple tournaments and leagues to get the on-ball/off-ball findings past the statistical-power ceiling one competition imposes
  • Build a live version that updates the midfield index in-game, positioned as a broadcast/coaching tool rather than a pre-match predictor
  • Add player-level tracking (where available) to replace the position-based proxies with true off-ball positional data
  • Turn the "descriptive vs. predictive" test itself into a reusable module other sports-analytics projects could run against their own metrics

Built With

Share this project:

Updates

Submission history