For many baseball fanatics, the upcoming MLB season means the beginning of fantasy baseball. As we try to find ways to build the strongest team week after week, we may eventually end up in situations where streaming is no longer an option. Everyone knows about streaming pitchers, but what if there were a way to reverse the roles and stream hitters? Could it be possible to find hitters with favorable matchups based on pitcher tendencies?
What it does
Our application returns a heatmap of both the batter and the pitcher the user selected to allow them to see if the batter they want to stream has a favorable matchup. In addition to these two maps, if the hitter has had previous matchups against said pitcher, then these are shown as well.
How we built it
Our application is built using the shiny web application framework for R.
Challenges we ran into
The biggest challenge we faced was retrieving the data. It was sometimes hard to navigate through the thousands of clustered files and to return a value based on these.
Accomplishments that we're proud of
Despite not finish everything we had planned, we are very happy to have created a good foundation for a project that we envision working on in the future.
What we learned
The one thing we learned is to make sure we work on the data sets at the same time as the UI instead of doing them one after the other!
What's next for baseball-heatmaps
There are many more data points that can be considered when making a streaming decision. Night vs day games, batting history in a specific park, history vs right-handers or left-handers, historical output at expected temperature, strength of the defense behind the pitcher, strength of the relief corp coming in after the starter, etc. AI can be used to weight each of these data points and return a single composite score for each hitter. This allows the fantasy manager to make a simple decision based on a variety of complex inputs.
There’s also a possibility of building clusters of similar pitchers. This would solve the problem of not having enough historical data for a specific hitter-pitcher matchup.