← All projects
Baseball · Data Science

⚾ Pitch Count Analysis

Mathematically deducing optimal pitch counts for MLB pitchers using regression and machine learning. The 100-pitch limit is baseball folklore, not math. This project uses pitch-level data to measure what pitch counts actually do to pitcher effectiveness and to estimate where the true point of diminishing returns sits for different pitcher profiles.

Research Questions

Methodology

The plan moves from interpretable baselines to heavier machine learning: descriptive curves by pitch-count bucket, then logistic and mixed-effects regression with pitcher random effects, then gradient boosting and survival analysis with SHAP values to keep the models interpretable.

The big confounder in all pitch-count research is selection bias: pitchers who reach 110 pitches are the ones pitching well, so naive curves understate fatigue. The analysis controls for times-through-the-order and in-game performance state, uses within-pitcher comparisons, and treats velocity and spin decay as fatigue signals that do not depend on outcomes.

Data

Statcast via pybaseball is the primary source: every MLB pitch since 2015 with full physics (velocity, spin, location, exit velocity, xwOBA), roughly seven million pitches for 2015 through 2024. The MLB StatsAPI extends pitch sequences back to 1988, with Retrosheet available if the at-bat analysis wants even more history.

Status: in progress