If You Build It… Or, How I Learned to Build a Competent Fantasy Baseball Bot

Gerrit Hall
3 min readMar 13, 2018

--

To build a robotic baseball coach, I suppose you need a robot that can spit tobacco, kick dust, and yell at umps

In order to justify my participation in fantasy baseball this season, I’ve opted to use the season to publicly discuss my methodology and transcribe my efforts towards building a bot that will automate the day to day tedium of managing a winning fantasy baseball team.

Warning to baseball fans — I find baseball to be a spectacularly boring sport and will pepper this whole series with digs against the tediousness of the sport and the insipid nature of its fans. Yet if you are thick-skinned enough to stick around you may find an edge in your season.

The wise majority who find the sport insipid may appreciate this series in that it will explore how to retrofit data science techniques to solve complex problems on a shoestring budget. Since I myself knew very little about baseball going into the season I will keep player discussions to a minimum. Regularly I will explore tangents to how these quantitative techniques readily apply to good sports like basketball and even oddball applications such as cryptocurrencies.

Background: A League of My Groans

Some years back my dull baseball friends were having trouble rounding out their absurdly large 18-team league so they invited me to join. Such a format could put me at a relative advantage. In such a large league, most of the “good” players are off the table quickly, so the day-to-day is consumed by sifting among scrubs, benchwarmers, and belly-itchers. This provided me an opportunity, as I felt quantitative analysis could outperform human opinion.

After many seasons pursuing more interesting diversions, during the 2017 season I finally broke down and decided to spend some amount of time trying to crack the fantasy baseball code. It ended up proving a more complex problem than I initially thought, but a years’ effort generated good results and I feel I can publicize the more rudimentary techniques without losing my edge in upcoming seasons.

Our league format is awful, due to the incompetence of our founding commissioner. We have 18 teams broken into three divisions, playing weekly head-to-head categories with 6 roster moves per week. Teams are allowed three keepers each year. Positions are 1 slot for each fielding position, a utility spot, 7 pitching slots (2 starting, 2 relief, 3 general), and just 3 bench slots.

  • Hitting: Runs, Home Runs, RBIs, Stolen Bases, Strikeouts, AVG, OPS
  • Pitching: Innings Pitched, Wins, Losses, Saves, Strikeouts, ERA, WHIP

The poor selection of categories will be discussed at length throughout the series, but where possible I’ll keep the focus of the series on how to generalize the bot toward any league. Indeed, the underlying source code was readily transferable to basketball, a clearly superior sport.

Current Articles:

--

--