Inspiration
After a tennis match you get a long list of stats: aces, first-serve %, break points saved, return points won, and more. These stats overlap. A big server hits more aces and also wins more first-serve points, so regression coefficients and correlations can't tell you which stat matters most.
We wanted an importance ranking that adds up to 100% and shows how it changes from hard courts to clay to grass.
What it does
We fit a model that explains about 62% of the variance in ATP match outcomes using seven serve and return stats. Then we split that 62% fairly among the stats for each surface, and show the results in an interactive Streamlit dashboard.
Live dashboard: https://tennis-win-factors-cf2nhibwx4dq2jkuvenk63.streamlit.app/
Each stat's share of what the model explains (all surfaces):
- Return points won: 36.5%
- First serve points won: 25.9%
- Second serve points won: 18.1%
- Break points saved: 10.6%
- Ace rate: 5.0%
- Double fault rate: 2.3%
- First serve in: 1.5%
Key findings
Returning matters most on every surface. Return points won accounts for 35–38% of the explained variance, more than any serve stat, even on grass.
Clay rewards rally and return play. Return points won counts for the most on clay (37.6%), and aces count for the least (4.2%).
Grass rewards free points and clutch serving. Break points saved (13.0% vs 9.0% on clay) and aces (6.6% vs 4.2%) matter clearly more on grass.
First-serve % barely matters on its own (1.5%). What counts is winning the points behind the serve.
How we built it
Data: We used Jeff Sackmann's tennis_atp match files for 2015–2024 (CC BY-NC-SA 4.0). We kept hard, clay and grass matches and dropped retirements, walkovers and matches with missing serve stats. That left 25,836 of the 27,672 matches: 15,138 on hard, 7,870 on clay and 2,828 on grass.
Features: We built one row per match. A seeded coin flip picks which player is "A", so wins and losses are balanced. Each of the 7 features is Player A's rate minus Player B's rate.
Model: We fit a linear regression for each surface. It predicts whether Player A won from the 7 stat differences, and explains about 62% of the variance on every surface.
LMG / Shapley decomposition: We fit the model on all 128 combinations of the 7 stats. A stat's share is how much R² it adds on average when it joins the model, taken over every possible order of adding the stats. This is the same idea as Shapley values from game theory, and the shares add up exactly to the full model's R².
Validation: As a check, a logistic regression reaches 92–94% accuracy on held-out matches. We also bootstrapped the shares 200 times per surface. The main clay vs grass differences all hold up at 95% confidence.
Tech stack: Python, pandas, NumPy, statsmodels, scikit-learn, Plotly and Streamlit.
Challenges we ran into
- Overlapping stats. Serve stats are strongly correlated, so standard coefficients gave unstable rankings. That's why we switched to LMG, which averages over every order of adding the stats.
- The data source disappeared. The original tennis_atp GitHub repo now returns a 404 error. Our download script falls back to archival mirrors, and we confirmed they are identical copies by matching file hashes across two of them.
- Edge cases. Break points saved is undefined when a player faced no break points. We set it to 100%, since the player never lost serve.
- Choosing the right model. LMG needs a clean R², which linear regression has and logistic regression doesn't. So we used linear regression for the decomposition and logistic regression only as a check.
What we learned
- Splitting R² answers "which stat matters most?" much better than comparing coefficients when the stats are correlated.
- Surface effects are real but smaller than we expected. The overall ranking stays the same, and the differences show up in the details.
- These stats describe what a win looks like on each surface, but they can't predict a match before it's played.
Takeaways for coaches and players
- Everywhere: train the return as hard as the serve.
- On clay: focus on return depth and building points rather than raw serve pace.
- On grass: practise serving under break-point pressure and aim for free points.
- Always: don't chase first-serve % for its own sake. Win the points behind the serve.
What's next
- Add WTA matches and Challenger-level data.
- Use pre-match stats, such as rolling player averages, to turn this into a forecasting tool.
- Break results down by player style, such as big servers vs. baseliners.
Log in or sign up for Devpost to join the conversation.