https://github.com/cpeoples/powerpredict
๐ฎ AI-powered Powerball & Mega Millions lottery number prediction using deep learning (Transformer + LSTM), Markov chains, and statistical analysis. Built with TensorFlow/Keras 3.
https://github.com/cpeoples/powerpredict
artificial-intelligence data-science deep-learning keras lottery-prediction lstm machine-learning markov-chain megamillions neural-network powerball python scikit-learn statistical-analysis tensorflow texas-lottery transformer
Last synced: 28 days ago
JSON representation
๐ฎ AI-powered Powerball & Mega Millions lottery number prediction using deep learning (Transformer + LSTM), Markov chains, and statistical analysis. Built with TensorFlow/Keras 3.
- Host: GitHub
- URL: https://github.com/cpeoples/powerpredict
- Owner: cpeoples
- Created: 2024-02-14T15:11:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-24T16:26:24.000Z (6 months ago)
- Last Synced: 2026-03-01T20:55:52.941Z (4 months ago)
- Topics: artificial-intelligence, data-science, deep-learning, keras, lottery-prediction, lstm, machine-learning, markov-chain, megamillions, neural-network, powerball, python, scikit-learn, statistical-analysis, tensorflow, texas-lottery, transformer
- Language: Python
- Homepage: https://github.com/cpeoples/powerpredict
- Size: 59.6 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ฎ PowerPredict - AI Lottery Number Prediction
[](https://www.python.org/downloads/)
[](https://www.tensorflow.org/)
[](https://keras.io/)
[](https://www.docker.com/)
**PowerPredict** is an advanced lottery number prediction system that uses **deep learning**, **statistical analysis**, and **ensemble methods** to generate Powerball and Mega Millions number predictions based on historical drawing data.
> โ ๏ธ **Disclaimer**: Lottery outcomes are random. This tool is for educational and entertainment purposes only. Please gamble responsibly.
---
## โจ Features
- ๐ง **Deep Learning Ensemble** - Transformer + Bidirectional LSTM/GRU hybrid neural networks
- ๐ **Multi-Strategy Analysis** - Frequency, gap, Markov chain, and pattern matching models
- ๐ฏ **Smart Diversity** - Guaranteed unique predictions with Hamming distance enforcement
- ๐ **Historical Data Analysis** - Analyzes 1,800+ historical lottery drawings
- ๐ณ **Docker Ready** - Containerized deployment with one command
- โก **Fast Predictions** - Optimized numpy/pandas operations
---
## ๐ Quick Start
### Using Docker (Recommended)
```bash
# Clone and build
git clone https://github.com/cpeoples/powerpredict.git
cd powerpredict
docker build -t powerpredict .
# Run predictions
docker run powerpredict powerball -n 5
docker run powerpredict megamillions -n 10 --analyze
```
### Using Python
```bash
# Clone repository
git clone https://github.com/cpeoples/powerpredict.git
cd powerpredict
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run predictions
python main.py powerball -n 5
python main.py megamillions -n 10 --analyze
```
---
## ๐ Usage
```bash
# Generate 5 Powerball predictions
python main.py powerball -n 5
# Generate 10 Mega Millions predictions with statistical analysis
python main.py megamillions -n 10 --analyze
# Quick mode (statistical only, no deep learning)
python main.py powerball -n 5 --quick
# Run 5 matrices for consensus analysis
python main.py powerball -n 5 --matrix 5
# Show help
python main.py --help
```
### Command Line Options
| Option | Description |
| ----------------------- | ------------------------------------------------------ |
| `powerball` | Predict Powerball numbers (1-69 + Power Ball 1-26) |
| `megamillions` | Predict Mega Millions numbers (1-70 + Mega Ball 1-25) |
| `-n, --num-predictions` | Number of predictions to generate (default: 5) |
| `-a, --analyze` | Show detailed statistical analysis |
| `-q, --quick` | Skip deep learning (faster, statistical only) |
| `-m, --matrix` | Number of matrices for consensus analysis (default: 1) |
---
## ๐งช How It Works
PowerPredict combines **four prediction strategies** into a master ensemble:
### 1. Weighted Statistical Model
Analyzes historical frequency, gap patterns, and positional tendencies to score each number.
### 2. Markov Chain Model
Uses transition probabilities to predict which numbers are likely to follow recent drawings.
### 3. Pattern Matching Model
Generates combinations matching historical patterns (sum ranges, odd/even ratios, high/low distribution).
### 4. Deep Learning Ensemble
- **Transformer** with multi-head attention for sequence patterns
- **Bidirectional LSTM/GRU** hybrid for temporal dependencies
- Temperature-based sampling to prevent mode collapse
### Master Ensemble
Combines all models with weighted averaging and enforces diversity:
- โ
No repeated Power Balls across predictions
- โ
Minimum Hamming distance between number sets
- โ
Full range coverage (no clustering)
---
## ๐ ๏ธ Technology Stack
ย ย
ย ย
ย ย
ย ย
ย ย
| Technology | Version | Purpose |
| ------------ | ------- | --------------------- |
| Python | 3.11+ | Core runtime |
| TensorFlow | 2.18+ | Deep learning backend |
| Keras | 3.0+ | Neural network API |
| NumPy | 1.26+ | Numerical computing |
| Pandas | 2.2+ | Data manipulation |
| Scikit-learn | 1.5+ | ML utilities |
---
## ๐ Sample Output
```
======================================================================
๐ฎ POWERPREDICT - INTELLIGENT LOTTERY ANALYSIS SYSTEM
======================================================================
Game: POWERBALL
Predictions: 5
Mode: Full (Statistical + Deep Learning)
๐ฅ Loading historical data...
โ Loaded 1885 historical drawings
๐ Running comprehensive statistical analysis...
โ Analysis complete
๐ง Training deep learning ensemble...
โ Training complete
======================================================================
โญ MASTER ENSEMBLE PREDICTIONS (HIGHEST CONFIDENCE)
======================================================================
๐ฐ MASTER ENSEMBLE:
--------------------------------------------------
#1: [ 6 - 22 - 32 - 51 - 57] Power Ball: 22 (agreement: 46%)
#2: [ 6 - 19 - 39 - 53 - 66] Power Ball: 12 (agreement: 44%)
#3: [ 7 - 30 - 40 - 49 - 63] Power Ball: 18 (agreement: 57%)
#4: [ 9 - 22 - 42 - 49 - 58] Power Ball: 15 (agreement: 54%)
#5: [ 8 - 13 - 21 - 42 - 53] Power Ball: 7 (agreement: 47%)
```
---
## ๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
---
## โ ๏ธ Disclaimer
This software is provided for **educational and entertainment purposes only**. Lottery outcomes are determined by cryptographically secure random number generators and cannot be predicted by any statistical or machine learning method.
- The probability of winning Powerball is 1 in 292,201,338
- The probability of winning Mega Millions is 1 in 302,575,350
**Please gamble responsibly.**
---
Made with โค๏ธ and ๐ค by cpeoples