MLB Player Analytics Engine
2025A player similarity search tool for baseball scouting, built for the 2025 SABR Analytics Conference.
This project was developed for the 2025 SABR Analytics Conference, which I attended on a sponsorship from Major League Baseball. It addresses a standard question in scouting: given a player's statistics, which other players in the dataset are most similar? Professional front offices rely on variants of this approach for projection and valuation, and the project is a small, transparent implementation of the same idea.
The work is presented as a Jupyter notebook written in Python, using pandas for data handling and scikit-learn for modeling. The input is a CSV of player statistics spanning three categories: conventional hitting metrics such as batting average, slugging percentage, and walk and strikeout rates; batted-ball measurements such as exit velocity, launch angle, and barrel rate; and newer swing metrics such as bat speed and attack angle. Each category captures information the others do not, which is what makes the resulting similarity informative rather than trivial.
Method
The pipeline is intentionally conventional. Missing values are imputed with the median, all features are standardized so that no single statistic dominates by magnitude, and pairwise similarity is computed with cosine similarity or inverse Euclidean distance. The interface reduces the operation to requesting the ten most similar players to a given name under a chosen metric.
The notebook additionally provides optional K-Means clustering, with the cluster count selected by the elbow method, together with PCA projections for visual inspection. These components are exploratory: their purpose is to verify that the similarity measure groups players into archetypes consistent with baseball intuition, such as separating contact hitters from three-true-outcomes hitters.
Discussion
The most instructive design decision concerned outliers. Standard practice removes them, but elite players are outliers almost by definition, so they were analyzed and retained. Working on the project during the conference also clarified the role of interpretability: a similarity list is useful only insofar as a scout can interrogate it, which favors a transparent pipeline over a marginally better score.