Back
Predictive model · 2023

WNBA Game Outcome Prediction

Built a model to predict WNBA winners, then re-tested it: found a data leak, rebuilt it on pre-game data only, and compared it with simple baselines.

Context

Aggie Analytics, UC Davis, Oct 2023 · re-tested 2026

Tools

Python, pandas, scikit-learn, Jupyter

Code

GitHub · Live app

In 2023 I wanted to know whether team statistics could predict who wins a WNBA game. I used the full 2023 regular season, 240 games across 12 teams, and built a model to predict whether the home team would win. It scored about 70%, and I built a small web app around it.

Coming back to the project, I checked that number more carefully. It did not hold up, and figuring out why taught me more than the original model did.

Try the live app

The first model

I merged the game schedule with each team's advanced statistics, like offensive and defensive ratings, shooting efficiency and turnover rates. A feature selector narrowed about 46 statistics down to 10, and a logistic regression model learned which side of each game they favored. I tested it on 1,000 random train/test splits.

Accuracy across 1,000 random test splits
50%
55%
60%
65%
70%
75%
80%
85%
The average was 70%, but individual runs ranged from about 60% to 79%. A single number hid how much the result moved.

Finding the problem

The first test I should have run was a simple baseline. Just picking the team with the better final record was right 73% of the time, better than my model.

That pointed to the real issue. My statistics were end-of-season totals, including each team's total losses, and I was using them to predict games from that same season. The totals already contained the results I was trying to predict. In practice, nobody has those numbers before a game is played.

Rebuilding it fairly

I rebuilt every feature from earlier games only: each team's win percentage so far, average point margin, form over the last five games, days of rest, and an Elo rating that updates after every game. Then I tested walk-forward through the season. Each of the last 160 games was predicted by a model trained only on games played before it.

Accuracy on 160 games, using only pre-game information
My modelsSimple rules
Model: record + margin so far
68.8%
Elo rating favorite
68.8%
Better point margin so far
66.9%
Better record so far
66.2%
Model: all 5 pre-game features
62.5%
Always pick the home team
53.8%
With 160 test games, a few points of difference is within noise. The full model's 90% range was 56% to 69%.

The honest answer is that this season was about two-thirds predictable. A two-feature model and a simple Elo rating tied at 69%, and adding more features made the model worse, not better. With only one season of data, simple was best.

The app

I rebuilt the web app in Streamlit on top of the new model. Pick a home and away team to get a win probability next to the Elo rating's view, see the walk-forward accuracy results, and browse every team's rating.

WNBA Matchup Predictor app showing Las Vegas Aces at home against New York Liberty in team colors, with a 59% win probability
The live app. Open it to try any matchup.

The Finals

The rebuilt model favored the Las Vegas Aces over the New York Liberty wherever the game was played. The Aces won the 2023 Finals 3–1, so it would have called 3 of the 4 games, missing only Game 3 in New York.

What I learned

Check for leakage before trusting a high score. Always compare against a simple baseline. Report a range, not a single number. Next, I would add earlier seasons and player availability, then test on 2024.

In short70% → 69%

The first score was inflated by leaked data. The honest re-test lands at 69%, tied with a simple Elo rating, and the notebook shows every step.

Back to all projects