Full Count
Calibrated MLB home-win probabilities, honest about the ~55–58% accuracy ceiling.
57.8% winner accuracy. Walk-forward backtest, 2018–2024, 15,372 games; about 55–58% is the realistic ceiling.
- Role
- Solo project for Michigan Edge, the University of Michigan sports analytics club: data pipeline, features, four models, the API and web app, and deployment.
- Stack
- Python, scikit-learn, XGBoost, PyTorch, FastAPI, Docker
- Year
- 2026
The demo's server sleeps when idle, so its first load can take up to 60 seconds.
The live app predicts any matchup. Pick two teams and a date and it returns a calibrated home-win probability on a matchup card, with each team's recent form and Elo rating. Only team form, Elo and the starting-pitcher proxy drive the prediction; the Players and Teams tabs chart this season's stats for context.

Key features and results
It is judged on calibration first: a 60% pick should win about 60% of the time, so log loss and Brier score come before accuracy. In a walk-forward backtest, logistic regression reached 57.8% on 15,372 games from 2018 to 2024, PyTorch 57.2% and XGBoost 56.4%; Elo on its own reached 57.0%. All of them sit inside the 55–58% range a leak-free baseball model should reach, which is part of the point: much higher would mean the pipeline was leaking.

Architecture
Every feature is a trailing window built only from earlier games: form over 10 and 30 games, rest days, bullpen fatigue, a park factor and the starting pitcher's recent runs allowed, plus an Elo rating written from scratch. Splits are chronological and a test checks that no feature sees a later game. The logistic regression is served by a FastAPI app, packaged with Docker and hosted on Render, with versions pinned after an unpinned build broke the saved model in production.

Origins
The most useful early result was a failure. Giving the PyTorch model an 8-dimensional embedding for each of about 480 starting pitchers, who average about 30 starts in a training fold, let it memorise individual pitchers: training loss fell to 0.61 while held-out log loss rose to 0.72, and accuracy dropped to 55.05%. Cutting the embedding to 4 dimensions and training for 10 epochs instead of 30 brought held-out log loss back to 0.68 and lifted PyTorch to 57.2%, past XGBoost. A bigger model is not automatically a better one.
