readme_content = f"""
Number Predictor (000-999) using Cash3 Lottery data. Started out as a simple model (markov chain) into multi-model framework designed to predict Georgia Cash 3 lottery outcomes using a hybrid of statistical, machine learning, and signal processing techniques.
- pandas numpy statsmodels scikit-learn scipy
- One of these ideas popped up in my head and somehow ended up doing too much. This is done for fun or in the name of it.
- Explore whether short 3-digit lottery outcomes (000–999) follow non-random patterns. - Very annoying part
- Use real historical draw data to:
- Train and evaluate predictive models.
- Combine diverse techniques using weighted ensemble logic.
- Output top N numbers with the highest prediction confidence.
- CSV scraped from Georgia Lottery's public Cash 3 results via a custom API scraper.
- Structure:
Date, Draw, Winning_Numbers- using this structure you could try this model on other data sources. - Cleaned and sorted so that most recent draw appears first. - Pain in the butt
Prediction Techniques Implemented (started out as markov chain only, will add the script here for that as well)
Each draw prediction includes the following models:
- Uses transitions from one number to the next.
- Works well for pattern recurrence.
- Tracks digit frequency in recent draws.
- Prioritizes hot numbers.
- Time series forecasting using
statsmodels. - Predicts future based on trend + seasonality.
- Compares recently hot numbers vs cold ones.
- Scores numbers based on deviation from average.
- Evaluates if digits tend to sum to specific ranges.
- Even/Odd (parity) and sum rules applied.
- Looks at the difference between digits and draw-to-draw.
- Time since last occurrence for each digit or combo.
- Uses modular arithmetic to uncover cyclical behavior.
- Scores numbers by how "disordered" or "structured" they appear.
- Fast Fourier Transform on digit frequency over time.
- Detects hidden periodic cycles.
- Second-order transition logic to detect deeper sequential patterns.
- Unsupervised ML clustering of draws using K-means.
- Compares digits vs previous digits with temporal offset.
- ML model trained on full feature set of previous draws using
RandomForest.
- Updates beliefs about what digits will appear based on past appearances.
## Accuracy & Backtesting
- Historical simulation from Jan 1 – Jul 25, 2025
- All predictions back-tested on actual outcomes
- Accuracy metrics include:
- Exact hit
- 2-digit match
- 1-digit match
- Total score
- Highest performing standalone model: **Gap Analysis** (Exact: 0.34%)
- Normalizes all models to [0, 1]
- Weights each method based on historical accuracy
- Scores all 000–999 combinations
- Outputs top N = 10 predictions per draw
historical_predictions_2025.csv– All daily predictions (per model)historical_accuracy_2025.csv– Summary of model performancefull_advanced.py– Runs prediction models and ensemble logicapi scrape this year.py– Pulls latest data from GA LotteryREADME.md– You’re here :)
While the lottery is widely considered random, this project operates under the hypothesis that:
- Small number sets (000–999) may reveal non-random tendencies over time.
- External predictors may capture hidden trends or operational quirks in the system.
readme_path = "/mnt/data/README.md" with open(readme_path, "w") as f: f.write(readme_content)