Machine Learning for Sports Betting: MLB Edition

Quant Galore
3 min readJun 22, 2023

Applying cutting-edge machine learning techniques to the fascinating world of sports betting.

For those that may be unfamiliar, sometime ago, I set out to try applying machine learning models to real-world sports betting with the goal of creating systematic, data-driven profits.

Well… that went well, very well:

As work on the algorithms progressed, we were able to expand to several key, novel features such as:

Synthetic Sportsbook Odds

A Scalable Data Infrastructure of Historical Records


Statistically Significant Models

By the end of the venture, what was left was a complete end-to-end machine learning workflow with a practical methodology for real-world deployment.

As it currently stands, there are no public resources that demonstrate how this can be done for someone who may not have extensive academic experience, until now.

We have created Machine Learning for Sports Betting: MLB Edition in order to close that gap:

This course formalizes the entire workflow and breaks down each component, leaving no stone unturned. Here’s a quick glance of the overall structure:

  1. The Technical Setup: In this stage, we go over setting up the necessary code environment as well as setting up the database to hold our datasets. We make use of free, hosted SQL databases so that the data is flexible and can be pulled from anywhere.
  2. Building the Dataset: This section represents the bulk of the code that will do the heavy lifting. We first construct the training dataset by pulling and cleaning historical MLB game data, stadium data, and even historical weather data. We then move on to the files responsible for training the models and analyzing the predictions.
  3. Betting Time: In the penultimate chapter, we take time to address key considerations, such as: odds optimization, bankroll management, and the optimal strategy. We then setup a live-testing environment that allows us to try out the strategy before going live with real money.
  4. Bonus Models: The bulk of the course is structured around MLB player prop bets for hits, but in this section, we include bonus models for home runs, strikeouts, RBIs, and more.

There is some Python experience assumed, but even with a beginners’ experience, you will be able to easily follow along.

And in typical Quant Galore fashion, many hours went into making sure that value was provided above all else, with the goal of making sure that you are able to successfully replicate the methodology and approach.

So, if you’re interested in trying your hand at applying cutting-edge machine learning models to real-world sports betting, I hope to see you there!

Machine Learning for Sports Betting: MLB Edition

Happy trading! :)



Quant Galore

Finance, Math, and Code. Why settle for less? @ The Quant's Playbook on Substack