Research project · Baseball analytics

Neural Pitch Lab

Pitch selection is a decision a pitcher makes a hundred times a game: which pitch, where, right now. Neural Pitch Lab is where I try to predict it. I train models on Statcast data to call the next pitch from the count, the matchup, and how the at-bat has gone so far. The numbers here come from the full 2024 season, scored on games the models never saw in training.

The idea

How predictable is the next pitch?

Every pitch is a logged decision with a measurable result, which makes pitching a clean place to study how people choose under pressure. I wanted to know how much of that choice you can call from context alone, and how much a good call is worth. So I built it end to end: pull the pitches, label them, train a model, and hold it to a baseline it has to beat.

The model

It reads the situation: the count, the matchup and handedness, the base-out state, and the pitches thrown so far this at-bat. From that it predicts the next pitch type. A gradient-boosted tree on those features does best; a Transformer over the sequence lands in the same range.

The baselines

Two rules keep it honest: the most common pitch for each count, and the tougher one, the most common pitch for each pitcher in each count. The model has to beat both, and it does.

Honest evaluation

I train on the earlier part of the season and test on later games, so the model is always judged on the future it hasn't seen. I report macro-F1 and top-three, not just raw hit rate, so a fastball-heavy guess can't look good by accident.

Why it's useful

What each dugout would do with it.

Predicting the next pitch sets one side against the other: the pitcher wants to stay unreadable, the hitter wants to read him. The same model helps both, for opposite reasons.

For the pitching side

If a model can read your patterns from the count and the matchup, so can a sharp hitter. The tool that flags your tells, the slider you lean on with two strikes, the fastball you reach for when you fall behind, is the tool that helps you mix it up and stay unpredictable.

For the hitting side

A hitter gets a fraction of a second to react, so anything that narrows the guess is worth a lot. Point the model at one pitcher and it becomes a scouting report: in this count, against this batter, here is what tends to come and where. A hitter can sit on a pitch or a zone with more confidence, and a coach can spot the pitchers whose patterns are easiest to attack.

Results

Good, and near the ceiling.

On the full 2024 season the model beats both baselines, and the true pitch type lands in its top three about 88% of the time. Top-1 tops out near 0.45. That is close to the ceiling for calling one of ten pitch types in today's game, where arsenals are deep and pitchers are less predictable than they were a decade ago. The useful output is that ranked shortlist, not a single hard guess.

·Loading…
·Loading…
·Loading…

By the numbers

Every model against its baseline.

Pitch type is one of ten classes. Fastball versus offspeed is the classic binary check, and a good sanity test: on it the model reaches 0.62, in range of the older published work once you account for how much less fastball-heavy the game is now.

Charts

What the data and the training look like.

How the pitches spread across the season, how the baseline scores, and how training goes. Train and held-out loss flatten together, which is the shape of a low-ceiling problem: there is only so much signal to find.

Prior work

This is a well-studied problem.

Predicting the next pitch goes back more than a decade (Ganeshapillai and Guttag, 2012; Sidle and Tran, 2018), and every club has its own version. I am not claiming a new method. What I wanted was an honest, reproducible pass on public data, with the baselines stated plainly and the numbers reported the way they should be.

Honest caveats

What this is, and isn't.

  • Calling one of ten pitch types tops out near 45% in today's game. The useful output is the top three and the calibrated odds, not a single hard guess.
  • The model learns the pitches that were thrown, which is not the same as the best pitch to throw.
  • It is pooled across pitchers. A per-pitcher model would squeeze out a little more, at the cost of needing many pitches per arm.
  • A live, in-game version would need pitch data I am allowed to use that way, and I have not lined that up.