Skip to content

A simple machine learning project that uses Random Forest Regressor to predict the winning spread of baseball games based on sportsbook lines. The project fetches data from The Odds API, preprocesses it using pandas, trains a model using scikit-learn, and sends an email with the day's recommended bets using the Gmail API.

License

Notifications You must be signed in to change notification settings

paulshryack/Recommended-Bets-By-Email-MLB

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLB Betting Recommendation Emailer

This machine learning model utilizes a Random Forest Regressor to generate recommended spread bets for Major League Baseball (MLB) games. The model fetches game data from The Odds API, which aggregates data from reputable sportsbooks such as Fanduel, DraftKings, and Barstool.

The model considers several key performance metrics that reflect a team's past performance in the current 2023 season such as:

R: Runs,

H: Hits,

R/G: Runs per Game,

OPS: On-base Plus Slugging,

and more.

By comparing these metrics with the latest betting lines offered, the model can predict which spreads are most likely to be successful.

Example Email

Example

Technologies Used

  • Python
  • Pandas
  • NumPy
  • Scikit-learn
  • HTML
  • CSS
  • Gmail API
  • The Odds API

How to Use

  1. Create an account with The Odds API to get an API key. The API key is then used as an argument to the fetch_data_from_api() function in the script.

  2. Obtain credentials for Gmail API. These credentials should be stored in a credentials.json file in the root directory of the project. Read more on setting up the Gmail API with Python here

  3. Replace msg["To"] = "YOUR_EMAIL_HERE" on line 247 with the email you want to receive the recommendations to.

  4. Once the above prerequisites are completed, you can run the main() function to fetch the betting lines, generate recommendations, and send an email with the recommendations to a specified recipient.

Contribute

Everyone is welcome to contribute to this project! Feel free to add new features, fix bugs, or make improvements. Just fork the repository, make your changes, and submit a pull request. I appreciate your help! :)

Disclaimer

This project is intended for educational purposes only. It should not be used as the sole basis for actual betting decisions. Betting involves risk, and you should only bet with money you can afford to lose. Always bet responsibly.

About

A simple machine learning project that uses Random Forest Regressor to predict the winning spread of baseball games based on sportsbook lines. The project fetches data from The Odds API, preprocesses it using pandas, trains a model using scikit-learn, and sends an email with the day's recommended bets using the Gmail API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%