Implementation of Reinforcement Learning to pick Powerball winning numbers
Two Python scripts:
- Pull historical Powerball winning numbers
- Learn from the data and pick the next winning number
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.
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:
- A 69-columns matrix
- 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."