Learn

How to build a sports betting model that survives contact with a real season

A betting model is a pipeline, not a regression. This is the order the stages have to happen in, the number each stage produces, and the six places where the pipeline quietly lies to you by scoring on information you would not have had.

Updated October 24, 2026 · 14 min read

Educational only. No model can guarantee profit.

  1. Define the target as a number, not a label
  2. Build features you could have computed at kickoff
  3. Split by time, never at random
  4. Validate by walking forward
  5. Check calibration, not just accuracy
  6. Convert to a price and compare to the market

Every stage exists to answer one question. “would I have known this at kickoff?”

Define the target as a number before you define anything else

The single most consequential decision in a betting model is what you ask it to predict. Most beginner models predict the wrong thing and then spend months improving a metric that cannot make money.

Predict margin

How many points does each team score?

A regression on the final margin, or on each team's score, produces a distribution you can cut any way you need: spread, moneyline, total, team total. This is why margin first is the standard advice: one model, many markets.

Output: a number in points, plus the spread of your errors.

Predict a probability

Who wins, and how often?

A classifier on the winner is easier to fit and much harder to turn into a bet, because a moneyline price is a probability and a classifier's raw score is not one. If you start here you must calibrate before the output means anything.

Output: a probability, which is not yet a price.

Predict the price

What will the market say?

Predicting the closing line is a legitimate research task and a terrible betting target. If your model's output is the market's own number, your edge is the gap between them, and you have built a model to measure a residual rather than to find one.

Output: a price, which cannot beat the price it predicts.

Whichever you choose, write down the unit and the horizon. “Will the home team cover?” is not a target, because it depends on a line that moves. “What is the final margin, measured at kickoff?” is a target.

Feature engineering is mostly a discipline about time

A feature is not a statistic. It is a statistic plus the timestamp at which it became knowable, and the second part is where models break.

The rule that resolves almost every judgement call: at the moment the bet would be placed, would this number already exist in the state you are using? If the answer is anything other than an unambiguous yes, the feature is a leak until proven otherwise.

Opponent-adjusted, not raw

Raw per-game totals mostly measure the schedule. A team that allowed 14 points a game against weak opponents is not a good defence, and a model fed raw totals learns the schedule instead of the team. Adjust for who the numbers were produced against.

As-of timestamps, not season totals

A season-average statistic computed over the whole season includes games that had not been played yet. Every rolling feature needs an explicit “as of week N” definition, and the week N you train on has to precede the game you are predicting.

Fewer features, chosen for a reason

Adding features raises your in-sample score almost mechanically, including when the features are noise. A model with sixty inputs will look better on your historical data and travel worse, because most of those sixty are fitting the past rather than forecasting the future.

Shrinkage where the sample is thin

Early-season rates are computed on one or two games. Without shrinking them toward a prior, the model treats a 60-point Week 1 win as a permanent statement. Blend early-season estimates toward the previous season or a league average, with the blend weight falling as games accumulate.

Spread and total are not independent

A model that predicts both the margin and the total without linking them will happily produce a 3-point favourite in a 62-point game and a 10-point favourite in a 40-point game. Constrain the two outputs so they agree with each other.

Write the feature down before you test it

Deciding which features to keep by looking at the test result is a leak with extra steps. Fix the feature set, then score once. If you iterate on the score, you are fitting the test set and it is no longer a test.

Six leaks, and what each one looks like from the inside

A leak is any path by which information from the future, or from the answer, reaches the model during training. Leaks do not announce themselves: they appear as an unusually good result.

Leak What it is What it looks like
Look-ahead bias A feature that only exists after the event, such as a season-long average or a final-season ranking. Strong results that evaporate the moment you compute every feature as of its own game week.
Closing-line leakage The closing price, or anything derived from it, entering as a feature while the target is defined against that same price. The most flattering leak there is: your model is being graded on the answer it was handed. The fix is to keep the market out of the feature set entirely and use it only as the benchmark you compare against.
Post-event data Box-score statistics, drive outcomes or play-by-play aggregates from the game being predicted, or from games later in the same week. Near-perfect accuracy on a subset of games, usually the ones with the most detailed data coverage.
Roster and injury timestamps Using the injury report as published today rather than as published at the time of the bet, or a depth chart that reflects a decision made after the game. A model whose accuracy drops sharply on games with late injury news, because in training it already knew who played.
Preprocessing leakage Fitting a scaler, an imputation rule, a target encoder or a feature selection on the full dataset before splitting. Modest and consistent optimism rather than a dramatic one. Fit every transformation on the training fold only, then apply it unchanged to the test fold.
Group leakage The same team, player, game or week appearing in training and in test, so the model can recall rather than generalise. Strong scores that hold up in a random split and collapse in a chronological one.

Why the closing line is the leak to watch for first

It is worth seeing the size of the effect, because it explains why the leak is so tempting. Take a model whose team-strength features explain about a third of the variance in final margin. Add the closing line as an input and the fit jumps to roughly eighty-five percent, because you have handed the model a very good estimate of the thing it is being asked to predict.

residual sd from a 13.5-point margin

R^2 = 0.33 -> 13.5 x sqrt(1 - 0.33) = 11.05 points

R^2 = 0.85 -> 13.5 x sqrt(1 - 0.85) = 5.23 points

The report says the model improved. What actually happened is that the market's opinion was moved from the benchmark column into the feature column, and the reported improvement is a measurement of the closing line, not of your handicapping. A model that uses the close and then claims an edge over the close has not found an edge.

Split by time, and then split by time again

A random split on sports data tells you whether your model can recognise games it has already seen. It cannot tell you whether it can forecast a game it has not.

The random split

Training on a random 80% of games and testing on the remaining 20% puts Week 3 games from a season into the training set and their own Week 4 rematch into the test set. The model learns that team from the same season, the same roster and often the same opponent. Performance is inflated and it is inflated most for features that are stable within a season, which is most features you care about.

The chronological split

Train on seasons up to a cutoff and test on everything after it. This is honest and it is a single number, which makes it fragile: one unusual season in the test period and your verdict is about that season rather than about the model. The related trap is tuning anything against the test season, which converts it back into a training set with extra ceremony.

Walk-forward validation, which is the one to use

Train on everything up to a point, predict the next block, then move the point forward and repeat. Each fold retrains on data that includes the previous fold's test period, which is exactly what you would do in production, and each fold produces its own score, so you get a distribution instead of one number. It is slower, it is honest, and it tells you whether the model is stable or whether the headline result came from one good season.

  • Fold 1. train seasons 1-4, test season 5.
  • Fold 2. train seasons 1-5, test season 6.
  • Fold 3. train seasons 1-6, test season 7.

Report every fold. A model that scores well on five folds and poorly on one is a different object from a model that scores modestly on all six, and a single averaged number hides the difference.

Calibration is the property that decides whether you can bet the output

A model can rank games correctly and still be wrong about every price, because ranking and probability are different properties. Betting uses the probability.

A model is calibrated when the games it gives a 75% chance to are won about 75% of the time. The standard check is a reliability diagram: bin the predictions, and plot the average predicted probability in each bin against the observed frequency. A calibrated model's points sit on the diagonal. The table below is a model that is confidently miscalibrated, which is the usual direction in sports models trained on small samples.

Predicted band Mean prediction Observed Games Gap
50 to 60% 55% 54% 400 1.0 points
60 to 70% 65% 62% 220 3.0 points
70 to 80% 75% 69% 110 6.0 points
80 to 90% 85% 74% 50 11.0 points
90 to 100% 94% 80% 20 14.0 points

The pattern is the one to memorise: the error grows with confidence. Weighting each gap by its bin size gives an expected calibration error of 3.19 percentage points, which sounds small and is not, because the miscalibration is concentrated exactly where the model would tell you to bet.

What miscalibration costs at a real price

Put that model against a market priced at -110, where the break-even probability is 52.381%. Suppose the model is wrong in the same direction by the same amount at every level, overstating its own probability by five points. The edge it reports and the edge that exists are then permanently different numbers.

Model says Truth Edge it claims Edge that exists Overstated by
55% 50% +5.00 -4.55 9.55
60% 55% +14.55 +5.00 9.55
70% 65% +33.64 +24.09 9.55
80% 75% +52.73 +43.18 9.55

Figures are expected value per 100 staked at -110, where the decimal price is 1.9091. The overstatement is the same 9.55 in every row, because a fixed error in probability maps to a fixed error in expected value at a fixed price: 5 points multiplied by 1.9091. The first row is the one that decides whether the model is any use. A model that believes 55% and is really 50% is not a slightly optimistic model, it is a model betting into a negative expectation with confidence.

Measure calibration on held-out data

A model is calibrated on the data it was fit to by construction. The reliability diagram that matters is drawn on predictions the model has never seen.

Prefer the monotonic correction

Fitting a simple sigmoid correction to the raw score keeps the ranking intact and needs less data. The more flexible step-wise alternative bends harder to the calibration set and will overfit a sample of a few hundred games.

A better score is not better calibration

Lower Brier loss or log loss can come from sharper discrimination rather than from better calibration, so a lower number does not prove the probabilities are usable. Read the reliability diagram before you read the score.

Turn the output into a price, then let the sample size tell you what you know

A probability becomes a bet only after you compare it with a real price and ask whether the difference is larger than your uncertainty about your own model.

How wide the uncertainty is

Even a genuinely good model produces a noisy estimate of its own accuracy. Hold a model that wins 55% of its bets against a -110 price, and the confidence interval around that number depends entirely on how many bets you have.

Bets 95% interval Half-width
200 48.1% to 61.9% 6.9 points
400 50.1% to 59.9% 4.9 points
800 51.6% to 58.4% 3.4 points
1,600 52.6% to 57.4% 2.4 points

At 200 bets the interval straddles the 52.381% break-even comfortably. A model at that sample could be profitable or losing and you cannot tell which from the record.

What an edge of a given size costs to prove

The same arithmetic from the other direction. To distinguish a real 3% return per bet from noise at 95% confidence, the number of bets required depends on how much the individual results vary.

n = (z x sd / mean)^2

sd 0.50 units, 3% edge -> n = 1,068

sd 0.95 units, 3% edge -> n = 3,853

Spread bets at -110 have a per-bet spread of about 0.95 units, so the second row is the realistic one. A 3% edge needs several thousand bets before the record is evidence rather than a rumour, which is why closing line value is used as the earlier check: it reaches a verdict in dozens of bets instead.

What a good backtest does not establish

It does not establish that you have an edge. A backtest is a measurement of your pipeline against data you chose, and every choice in that pipeline was made by someone who had already seen the data. The leaks section above is a list of the ways the number gets quietly better without the model getting better.

It does not establish that the market will let you bet it. Limits, price movement between deciding and placing, and the possibility that the prices you backtested against were never available at the size you want all sit between a backtest and a bankroll.

It does not survive a change in the market. A model fitted to seasons when a market was soft degrades as it sharpens, and the degradation is invisible in the historical record because the record is what the market used to be.

And it does not remove variance. A model with a genuine edge loses on plenty of individual games, and a well-calibrated 60% chance is wrong four times in ten. As one practitioner puts it, a high win probability can still lose tonight and still be a sound research lean over a long sample. The long sample is the only place the model can be judged, and getting to it takes years.

The shortest honest summary

Build the simplest thing that could work, on one league and one market. Compute every feature as of kickoff. Split by time and walk forward. Check calibration before you check profits. Compare against a real price rather than against your own last score. Expect the work to be in the data pipeline rather than in the model, because it almost always is.

Build the pipeline before you build the model

A research workspace that stores features with their as-of timestamps, splits by time, and reports calibration alongside accuracy turns the tricky parts of this page into defaults.

Explore the research workspace · How edge is measured

Questions people ask

What should a sports betting model predict?

Predict the margin as a number, or each team's score, because a margin can be cut into a spread, a moneyline, a total or a team total. Predicting the winner directly is easier to fit but the raw output is not a probability and must be calibrated before it can be compared with a price. Predicting the closing line is a reasonable research exercise and a poor betting target, since your edge would be the gap between your model and the thing it is predicting.

Why is a random train/test split wrong for betting models?

Because sports data is ordered. A random split puts a team's Week 3 game in training and the same team's Week 5 game in test, so the model is scored on recognising a team it has already seen rather than on forecasting one it has not. Split chronologically, and better, validate by walking forward: train on everything up to a point, test the next block, move the point and repeat.

What is the most common form of data leakage in betting models?

Using the closing line as a feature and then measuring the model against that same line. It is the most tempting leak because the effect is large: adding the close to a model whose team-strength features explain about a third of margin variance lifts the fit to roughly eighty-five percent, which is a measurement of the closing line rather than of any handicapping. Keep the market out of the feature set and use it only as the benchmark.

How do I know if my model is calibrated?

Bin its predictions and compare the average predicted probability in each bin with the observed frequency. A model that is calibrated has those two numbers equal across the whole range. The usual failure is overconfidence that grows with the probability, so the 85% band wins 74% of the time. Weighted across bins that is an expected calibration error of a few percentage points, concentrated exactly where the model tells you to bet.

How many bets do I need to know my model works?

It depends on the size of the edge and the variance. Detecting a 3% return per bet at 95% confidence takes roughly 1,068 bets if the per-bet spread is half a unit, and roughly 3,853 if it is 0.95 units, which is what a spread bet at -110 actually has. Even a real 55% win rate needs around 800 bets before the confidence interval separates from the break-even. Closing line value is used as an earlier check because it reaches a verdict in dozens of bets rather than thousands.

Sources

  1. Chapter 3 Modeling | Beating Vegas: Creating a Dynamic Sports Betting Model, dlevine820.github.io
  2. Leakage (machine learning), en.wikipedia.org
  3. Probability calibration, scikit-learn.org
  4. College Football Modeling Tips, radsportsanalytics.com
  5. College football betting model using xgBoost to predict game spreads, github.com
  6. Intro to Data Science: The Road to Sports Betting Models, unabated.com
  7. What Sports Betting Model Outputs Mean, rithmm.com
  8. How to Build a Sports Betting Model: Expert Tips & Advice, oddsshopper.com
  9. How to Build a Sports Betting Model in Excel, oddsjam.com
  10. r/sportsbook: So how do you create a Model?, reddit.com
  11. Attempted Pinnacle model-building page, pinnacle.com