DEV Community

kmdspark5
kmdspark5

Posted on

Do NBA totals models beat the closing line? A 3-season, 3,216-game walk-forward test

Every totals model looks good in a notebook. The question that matters is simpler: does it beat the closing line — the market's final word before tip-off?

I ran that test properly: a walk-forward backtest over three full NBA regular seasons, 3,216 games, comparing my model's predicted total against the actual closing total for every game. Here is exactly what happened — including the parts that don't flatter the model.

The test

  • Model: GradientBoosting + RandomForest ensemble on leak-free, point-in-time team features (season-to-date stats blended with the prior season, plus last-10-games form). For each test season, the model was trained only on earlier seasons — no look-ahead.
  • Games: 3,216 regular-season games, 2023-24 through 2025-26.
  • Line: the closing total from the Kaggle NBA betting dataset.
  • Rule tested: bet the model's side (over if the prediction is above the line, under if below).

The headline numbers

Rule Win rate Bets
Bet the model's side on every game 48.7% 3,206 decided
Only when pred − line ≥ 8
Only when pred − line ≥ 10

Betting every game loses. The model does not beat the line on average — 48.7% is below the 52.4% break-even at standard -110 pricing.

The ≥8-point filter is the only rule that clears break-even in-sample: 53.7% over 807 bets, at 53.4% / 52.9% / 55.0% in each of the three seasons, worth about +2.4% ROI per bet at -110. Over-only was 53.3% (559 bets), under-only 54.4% (248 bets).

The ≥10 filter looks better at 54.7% — but on only 486 bets, so it's a noisier estimate, not a stronger claim.

What the 53.7% actually means

A 95% confidence interval on 807 bets runs roughly 50–57%. The lower end is break-even. This is evidence of a possible edge, not proof of one. Treat it as a hypothesis to test, not a system to trust.

Two checks keep me honest about the direction of the signal:

  • Fading the model at |diff| ≥ 8 wins only 46.3%. The signal, if any, is in the model's direction — not against it.
  • Buying points raises the win rate mechanically (buy 3 points → 55.0%) but at typical -170 pricing the break-even is ~63%. It costs more than it gains.

The live check so far: worse than the backtest

This is the part most write-ups skip. The same ≥8 rule applied to real games after the backtest period went 0–2 on Nov 18, 2026, and no game qualified on Nov 19–21. One more game qualified on Nov 23 (OKC @ IND, model 9.1 points above the line, toward over) and is awaiting grading. Out-of-sample performance so far is worse than the backtest — as it usually is.

Overall prediction error across the 3,216 games was MAE 15.50 points. Totals are hard. The model is decent at predicting totals; beating the market is a much higher bar.

Try it yourself

Everything is reproducible — the full per-game file is the point:

Use code LAUNCH25 for 25% off everything in the store until Nov 30, 2026.

The companion dataset and how it was built leak-free is in my earlier post: https://dev.to/kmdspark5/i-built-a-leak-free-nba-dataset-and-my-model-still-doesnt-beat-the-closing-line-mib

Source code and the free sample data live on GitHub: https://github.com/kmdspark5/nba-point-in-time-features

The honest summary

  • A totals model does not beat the closing line on average (48.7%).
  • One filter — only betting when the model disagrees with the line by 8+ points — cleared break-even in-sample (53.7%, 807 bets, CI ~50–57%).
  • Live, that same rule is 0–2 so far. The edge may not survive out of sample.

Nothing here is betting advice and nothing guarantees future results. If you use the data, use it to test a hypothesis — including the hypothesis that the edge doesn't exist.

Top comments (0)