
Next Pitch
Machine-learning models that predict the next pitch in a Major League at-bat, including whether it will be a fastball and how fast it will be.
What it does
Before every pitch, the count, the pitcher's habits, what he just threw, who is hitting and who is catching all shift what is likely to come next. I wanted to see how much of that a model could learn, and to test it on games it had never seen, including the 2026 postseason.
Technical details
- Data
- 4.36 million Statcast pitches from 2021 to 2026
- Split
- Trained on 2021 to 2024, tuned on 2025, tested on the 2026 regular season, with the 2026 postseason held back as a final check
- Model
- XGBoost, built up in layers: the count, then the pitcher, the pitch sequence, the hitter and the catcher
- Live
- A local page that reads MLB's live game feed and shows the model's call before each pitch
Results
Fastball or not
65.1% correct on 713,314 pitches from the 2026 regular season and 65.6% in the postseason, against 55.4% and 58.7% for always guessing fastball. When the model was at least 70% sure, it was right about 80% of the time.
Each layer counts
Every layer, from the pitcher's tendencies to the catcher, made a measurable improvement on games the model had never seen. The pitcher and the pitch sequence added the most.
Pitch speed
A second model predicts whether a pitch will come in over or under a given speed. It was right 65.5% of the time across the 2026 season and 66.8% in the postseason.
How an at-bat ends
A third model predicts whether an at-bat ends in a strikeout, walk, single, extra-base hit, home run or out. In the 2026 postseason, the 10% of at-bats it rated most likely to end in a strikeout did so 43% of the time, against 11% for the bottom 10%.
Engineering decisions
Only what was known at the time
Every player stat is built only from games before the pitch, and every result comes from seasons the model never trained on, so the accuracy reflects what it could have known in the moment.
Speed by pitch type
The speed model keeps a separate speed profile for each of a pitcher's pitch types and blends in what he is throwing that night, rather than treating every off-speed pitch as one.