This repository contains two projects that use machine learning models to predict future lottery numbers for Mega Millions and Powerball.
- megamillions.csv: Dataset containing historical Mega Millions draw data.
- powerball.csv: Dataset containing historical Powerball draw data.
- predict_megamillions.ipynb: Jupyter Notebook demonstrating the prediction model for Mega Millions.
- predict_powerball.ipynb: Jupyter Notebook demonstrating the prediction model for Powerball.
- Data Loading: The datasets are loaded using Pandas.
- Feature Selection: Relevant features (lottery numbers) are selected.
- Data Splitting: The data is split into training sets and labels.
- Normalization: The data is standardized using
StandardScaler
.
- LSTM-Based Neural Network: A bidirectional LSTM (Long Short-Term Memory) network is used for both projects.
- Hyperparameter Tuning: The model architecture and learning parameters are tuned for each lottery type.
- Training: The models are trained on historical data to learn patterns and trends.
- Rolling Window Approach: A sliding window is used to create sequences of past numbers for prediction.
- Model Inference: The trained model predicts the next set of lottery numbers.
- Post-Processing: The predicted numbers are denormalized and presented in a human-readable format.
-
Install dependencies: Ensure you have Python, Jupyter Notebook, and the following libraries installed:
- NumPy
- Pandas
- scikit-learn
- TensorFlow (or Keras)
-
Open the Jupyter Notebooks:
predict_megamillions.ipynb
predict_powerball.ipynb
-
Run the cells: Execute the cells in the notebooks sequentially to load the data, train the models, and generate predictions.
The models provide predictions for the next possible winning numbers in each lottery. Due to the inherent randomness of lotteries, these predictions are not guaranteed, but they offer insights based on historical trends.
This project is for educational and informational purposes only. The lottery is a game of chance, and there is no guarantee that these predictions will be accurate.
Feel free to fork this repository and experiment with different models, data sources, or features to improve the prediction accuracy. Contributions are welcome!
This project is licensed under the MIT License.