Skip to content

Implementation of Reinforcement Learning to pick Powerball winning numbers

Notifications You must be signed in to change notification settings

jt2002/Data-Science-for-Powerball

Repository files navigation

Data Science for Powerball

Implementation of Reinforcement Learning to pick Powerball winning numbers

Two Python scripts:

  1. Pull historical Powerball winning numbers
  2. Learn from the data and pick the next winning number

1. Historical Powerball Numbers

The script powerball_numbers.py scrapes the winning numbers from PowerBall.net using Request-HTML.

	$ pip install requests-html

It writes the numbers to a CSV file powerball_numbers.csv. The winning numbers from April 22, 1992 to October 16, 2019 powerball_numbers_since_1992.csv is available for download.

2. Predict the Next Winning Numbers

On October 4, 2015, the Powerball format was updated to use a 5/69 (white balls) + 1/26 (Powerballs). The data to feed the script should start from October 7, 2015.

The script pre-processes the winning numbers to 2 matrices:

  1. A 69-columns matrix
  2. A 26-columns matrix

Each row represents one draw where the columns of the winning number is 1 and 0 otherwise.

Then, the script picks 5 white balls and 1 powerball and prints the predicts winning number.

When using random.seed(0), Powerball to play is [9, 33, 41, 48, 56] [24]

Disclaimer: The author makes no warranties, guarantees or representations, of any kind, express or implied, as to the usefulness, completeness, or reliability of the information contained in the codes.

Quoted from https://www.powerball.com/play-responsibly: "Play Responsibly. Never spend more than you can afford on any lottery product. Please remember, it's just a game."

About

Implementation of Reinforcement Learning to pick Powerball winning numbers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages