PROJECT / ML
MLB Game Predictor
A daily Python pipeline that predicts MLB game winners and checks itself against the market.
- Python
- DuckDB
- scikit-learn
- XGBoost
- pandas
Source private: not published
- Type
- ML
- Source
- Private
- Role
- Solo personal project.
- Built with
- Python, DuckDB, scikit-learn

01 / Overview
Overview
Load the data
A bootstrap command downloads the 2023 to 2025 seasons and trains the models.
Predict each day
A daily run settles yesterday's predictions, refreshes data and predicts today's games.
Check against the market
Model probabilities are compared with, and blended toward, the market's probability.
02 / Context and problem
Context and problem
A long-running personal project: a single-file Python command-line tool with commands to bootstrap, run, train, predict and evaluate.
03 / My role
My role
Solo personal project.
04 / How it works
How it works
Elo ratings
Elo with a margin-of-victory multiplier and a starting-pitcher adjustment.
Features
Run differential, pitcher FIP, venue split, strikeout-minus-walk rate, bullpen FIP and park run and home-run factors.
Models
Calibrated logistic regression and XGBoost, plus a logistic stacker on time-series out-of-fold predictions.
Blend
The model probability is blended with the market probability in log-odds, weighted toward the market.
Store and settle
DuckDB holds games, predictions, pitcher and bullpen logs and weather; each run settles the previous day.
05 / Key decisions
Key decisions
Prune weak features
Weather and similar features had near-zero weight; pruning them raised honest accuracy from 0.563 to 0.571.
Blend toward the market
On settled games the model alone loses to the market on log loss.
06 / Results and numbers
Results and numbers
~57%
test accuracy, logistic model (time-ordered validation)
52.9%
home team wins baseline, 2023 to 2025
~366
games settled in daily runs, Aug 31 to Oct 1 2026 (approximate)
07 / Testing and quality
Testing and quality
- No automated tests; an eval command reports performance and runs are logged.
08 / Limitations
Limitations
- The market beats the model alone on log loss.
- Pitcher FIP uses full-season numbers, which leaks future information into training.
- The stacker's higher score was measured on its own training predictions, so it is not quoted.
09 / Next project