Loading…

Today's games

LOADING PREDICTIONS

Track record

Every graded prediction. Live predictions are recorded before first pitch and never edited afterwards.

Accuracy over the season

Running share of games picked correctly, against always picking the home team. Starts once 150 games are in.

Every prediction

DateMatchupFinalPickResult

How it works

Baseball Oracle predicts the winner of every MLB game. Each morning a scheduled GitHub Actions job pulls the latest results from the MLB Stats API, rebuilds the model's features for every game using only information available before first pitch, retrains the model, and publishes the predictions on this site. No server, no manual steps.

The pipeline

  1. 1
    Collect

    Every regular-season game since 2021 from the MLB Stats API: results, probable starters, plate umpires, box scores, and per-game logs for every starter and team. Game-day weather from Open-Meteo.

  2. 2
    Build features, as of the day before

    59 features per game: a projection of each starting pitcher, lineup strength against the starter's handedness, bullpen quality and workload, team form, rest and travel, park, weather and umpire. Each stat is rebuilt using only games played before that date. The pitcher projection works like the classic Marcel system: strikeout, walk and home-run rates from this season and the three before it, weighted toward recent seasons and pulled toward league average by how noisy each rate is.

  3. 3
    Validate walk-forward

    Each season is predicted by a model trained only on earlier seasons. Three models compete: a heavily regularized logistic regression on home-minus-away differences, a random forest, and XGBoost. The lowest out-of-sample log loss wins; currently that's the logistic regression.

  4. 4
    Calibrate

    Platt scaling, fit on those out-of-sample predictions, turns raw model scores into probabilities that mean what they say.

  5. 5
    Predict and publish

    The model is retrained on everything, today's games are scored, and predictions are locked in before first pitch. The site is static: just HTML and JSON files rebuilt by the pipeline.

The data leak I found

An earlier version of this model scored 60.5% on its test season. That would beat the betting market, which is a red flag rather than a result. The cause: pitcher, bullpen and batting-split stats were season totals, so a game in April already "knew" how a pitcher would finish in September.

Rebuilding every stat as of the day before each game dropped accuracy to 55.3%, in line with what the old model had actually done on live games. The lower number is the honest one, and it's the one everything on this site reports.

Season by season

Accuracy when each season is predicted by a model that never saw it, against always picking the home team.

Are the probabilities honest?

Out-of-sample games grouped by predicted home win chance. Points on the diagonal mean "60%" really wins 60% of the time.

Confidence pays off

Accuracy by how confident the pick was, with 95% intervals. Share of games in each band below.

What the model relies on

Built with

  • Data MLB Stats API · Open-Meteo
  • Features & inference Node.js
  • Training Python · scikit-learn · XGBoost
  • Automation GitHub Actions (scheduled)
  • Hosting GitHub Pages (static)

Source code: github.com/lolconnor1/baseball-predictor