Skip to content
Sid Prithvi
← Index
06 · Tennis forecasting model · Everything, solo · 2026 · Building for the Australian Open

Tennis Lab

I play, and I watch matches that have nothing to do with me on random Tuesdays, because I like watching tennis. That's the whole of it at the start. No thesis, no plan to build anything. What turned it into a project was a question I kept having and couldn't answer. A player struggles against one opponent and walks through another. Is that a real pattern, or a story I'm telling myself? A good run: is it form, or a soft draw? A rising player: actually rising, or just drawing well? Tennis is full of questions that sound like opinions but have real answers, if you can get at the data.

Work in progress

This one is still being built, the website included. The model is finished and measured. The app it feeds runs on my machine, not on a URL, so what follows is a project in progress, described as one.

The model's record page: log loss against the closing betting line, tournaments replayed, and where each US Open champion ranked in the day-one forecast

The Problem

It started during the US Open, with João Fonseca. Clearly good, clearly not top five, and I wanted to know where he'd actually finish.

A ranking tells you where someone has been. A scoreboard tells you what just happened. Neither tells you what's likely next, and the gap between those is the interesting part.

There was a second question I wanted and knew I couldn't honestly have. Would peak Federer win a slam in this field? I built the thing that answers the first, and enough machinery to be precise about why the second can't be answered.

The Decisions

  • 01

    Measure against the betting market, not against myself

    Accuracy only asks whether you picked the winner, so you can inflate it by pushing every prediction toward 0 or 1. Log loss punishes confident mistakes instead, which is the thing I actually care about. The benchmark had to be something with skin in the game, so it's the closing betting price. It doesn't beat the market and I never expected it to. Closing odds carry information that isn't public. Saying so is the point. A model that only reports the benchmark it wins against isn't reporting, it's advertising. The full comparison is in the next section, including the one it loses.

  • 02

    Logistic regression, after the fancier models lost twice

    I wanted the fancier model to win. I fixed the adoption threshold in the script before I saw any results, so I couldn't talk myself into it afterwards. Random Forest and XGBoost both lost to plain logistic regression. I thought the problem was data starvation, because XGBoost kept picking the shallowest tree depth available, so I rebuilt with four times the data and ran it again. It picked the shallowest depth again, on both tours. The interactions a deeper tree needs just aren't in these features. That's a refuted hypothesis, not a confirmed one, and it's in the repo either way.

  • 03

    The standard dataset was gone, so I rebuilt it

    Every guide to tennis analytics points at the same public repositories. They'd been taken down. I found that out by trying to download them, not by reading about it, and web search still returns years of articles telling you to use them. So I found three other sources, reconciled their conflicting schemas and player naming into one table, and wrote down where the coverage has holes instead of papering over them. That reconciliation is most of the work and none of the fun.

  • 04

    One model per tour

    Men play best of five at slams and women play best of three, and serve dominates less in the women's game. One model with a tour flag averages those differences away, so there are two. The women's model also runs with fewer features, because no free source publishes women's serve statistics. It reports that rather than imputing numbers it doesn't have.

  • 05

    Publish where it's wrong, on the page

    The site has a reliability curve: what the model said against what actually happened, in ten bands. Two of those bands are off, and they're marked in red on the page rather than left for someone to find. Same with the cross-era question. Peak Federer in this field returns a range, not a number, because the answer depends on an assumption nobody can check. The spread is the result. The default is set to the most conservative reading, because when a number can't be checked it should claim the least.

Scored against the market

Log loss on men's matches. It punishes confident mistakes, which accuracy does not, so it is the number worth reporting. The market's closing price is the line to beat and I don't beat it. Saying so is the point.

Log loss, lower is better · scale 0.55 to 0.72

  • Closing betting line0.5876

    The benchmark. Money at risk, and information that isn't public.

  • My modelmine0.5968

    About 0.009 behind the market.

  • Elo alone0.6126

    The baseline it had to beat, and does.

  • A coin flip0.6931

    Where you start.

What Shipped

Two models, one per tour, and a database anyone can rebuild from a script.

  • The replay

    It re-forecasts past tournaments using only what was known on day one. You can't fudge that.

  • The 2026 US Open

    0.4944 log loss across the draw. Both champions were 3rd and 2nd in the day-one forecast, out of 128.

  • A web app on top

    Five pages, including a predictor you can run and the method, written out so you can argue with it.

1.19M
Matches trained on

One database, regenerated from a script

92
Grand slams replayed

Re-forecast at every round

238
Tournaments replayed

Day-one information only

172
Tests

Three weeks, 36 commits

18K
Lines written

11,600 Python, 6,400 TypeScript

75.6%
Picked at the 2026 US Open

Against 74.0% for the higher rating

  • Python 3.11
  • DuckDB
  • pandas
  • scikit-learn
  • NumPy
  • SciPy
  • pytest
  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • launchd
  • Python 3.11
  • DuckDB
  • pandas
  • scikit-learn
  • NumPy
  • SciPy
  • pytest
  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • launchd

Where It Is Now

Still being built, and deliberately so. The model is the part that's finished: it beats every baseline it set for itself and sits about 0.009 of log loss behind the closing betting line.

The web app works, but it runs on my machine on a branch I haven't merged, so there's no public link yet. Two known defects are written down and unfixed, and the name is a placeholder.

I'd rather put it up when it's worth using than ship it to have a URL.