Inspiration

My bestfriend is a big football fan, and we kept arguing about the same thing. A striker has one amazing season, everyone calls him world class, and then a big club pays a huge fee for him. Next season he can't score. Was he ever that good, or did he just get lucky?

We wanted a way to actually check, using data instead of opinions.

What it does

GameSense shows whether a player's goals come from skill or luck.

For every shot, it works out the chance of it going in (this is called expected goals, or xG). A tap-in might be 60%, a long shot 3%. Then we compare how many goals a player should have scored with how many he actually scored.

The app has six parts:

  • Shot map: every shot for any team or player, on a pitch
  • Rate a chance: move the sliders and see how likely a shot is to go in
  • Skill or luck?: our main finding, plus a search for any player
  • Players to watch: a "buy" list (unlucky players due more goals) and a "sell" list (players likely to cool off)
  • Team shooting habits: which teams take good shots and which take hopeful ones
  • How accurate is it?: how we tested the model

What we found:

  1. Getting into good positions is a real skill. Scoring more than expected is mostly luck. We split each player's games into two random groups. Chance quality matched between the groups (0.67 out of 1). Scoring above expected didn't match at all (-0.04).
  2. Judge a player by his chances, not his goals. Chance quality predicted a player's future goals 22% more accurately than his past goals did.
  3. The model holds up. It's almost as accurate as StatsBomb's paid model (0.814 vs 0.816). It also worked on World Cup 2022 and Euro 2024 matches it had never seen: it predicted 254 goals, and 250 were scored.

How we built it

  • Data: StatsBomb Open Data, 41,562 shots from 1,666 matches (2015/16 Premier League, La Liga, Serie A, Ligue 1, part of the Bundesliga, plus World Cup 2022 and Euro 2024). Each shot includes where every player was standing at that moment.
  • Model: we turned each shot into features like distance, angle, defenders in the way, the keeper's position, headers and pressure. Then we trained two models (logistic regression and LightGBM) and kept the better one.
  • Testing: the model was always tested on matches it never trained on. We also compared it with StatsBomb's own xG.
  • Skill vs luck test: for each player,

$$\text{Goals above expected} = \text{Goals} - \sum \text{xG}$$

We split each player's games in half at random 50 times and checked if the same players stood out in both halves.

  • App: Python, Streamlit and Plotly, deployed on Streamlit Community Cloud.

Challenges we ran into

  • We started with an F1 project, but the data library suddenly asked for an F1 account login, so we switched to football.
  • Package version problems on Windows (pyarrow and NumPy didn't work together) took a while to sort out.
  • Getting the app online took a few tries. The deploy kept getting stuck and the page wouldn't load until we found the right settings.
  • Some numbers looked impressive at first but weren't fair. For example, our first "extra goals" estimate for teams was way too high. We changed it to only show things the data actually supports.
  • Explaining stats in plain words was harder than doing the stats.

Accomplishments that we're proud of

  • Our model is nearly as accurate as a paid industry model, using only free data.
  • It worked on international tournaments it had never seen.
  • We proved the main idea with a real test, not just a chart.
  • The app is simple enough for someone who doesn't know what xG is.

What we learned

  • One good season can be mostly luck, even across hundreds of shots.
  • How to test a model properly so it isn't "cheating" by seeing the answers.
  • Being honest about limits makes a project stronger, not weaker.
  • How to deploy a data app and fix it when it breaks.

What's next for GameSense

  • Add newer seasons so the buy and sell lists are about current players
  • Look at where in the goal the shot went, not just where it was taken from
  • Do the same for passing and chance creation, not just shooting
  • Add women's leagues, which StatsBomb also has open data for
Share this project:

Updates

Submission history