The AVG Leaderboard Had a 3-At-Bat Batting Champion

For a while, Ballpark Genius’s batting average leaderboard was topped by Justin Dean. Great glove, fine guy, 3 at-bats on the season. Samad Taylor (61 AB) and Tommy Edman (25 AB) were up there too. Aaron Judge was nowhere in sight.

The batting-average and ERA/WHIP leaderboards are supposed to carry a minimum sample size, at-bats for hitters, innings for pitchers, otherwise you get exactly this: someone who went 2-for-3 outranking someone who went 180-for-560. The backend already supported it. getStatsLeaders in the API client accepts minAtBats/minInningsPitched, the route maps them, the SQL applies them as AND at_bats >= N. The one place that was supposed to send them, a single call site in the leaderboards page, just didn’t. It only passed minGames.

One missing line, in other words, was the entire distance between “AVG leaderboard” and “who’s had the luckiest 3 at-bats this week.”

Ballpark Genius batting average leaderboard after the fix, led by Yordan Alvarez at .322 across 117 games played

Fixed, and now the real floors apply, 200+ AB for AVG/OPS, 50+ IP for ERA/WHIP. Judge, Alvarez, Arraez, the names you’d actually expect.