# ahmad-alam/lottery-prediction architecture

> Architecture diagram of the GitHub repository ahmad-alam/lottery-prediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ahmad-alam/lottery-prediction
- Repository: https://github.com/ahmad-alam/lottery-prediction

## Overview

This repository documents two notebook-based lottery prediction projects: Mega Millions and Powerball. Each uses historical draw data to prepare features, train a bidirectional LSTM, and generate predictions with a rolling window and post-processing. The README documents this workflow, but no notebook source excerpts were provided, so the relationships below reflect documented behavior rather than inspected implementation details.

Main entry points: [`MegaMillions.ipynb`](https://github.com/ahmad-alam/lottery-prediction/blob/main/MegaMillions.ipynb) (Mega Millions notebook), [`Powerball.ipynb`](https://github.com/ahmad-alam/lottery-prediction/blob/main/Powerball.ipynb) (Powerball notebook), [`datasets/megamillions.csv`](https://github.com/ahmad-alam/lottery-prediction/blob/main/datasets/megamillions.csv) (Mega Millions draws), [`datasets/powerball.csv`](https://github.com/ahmad-alam/lottery-prediction/blob/main/datasets/powerball.csv) (Powerball draws)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_projects["Lottery projects"]
  node_mega_notebook["Mega Millions notebook<br/>[MegaMillions.ipynb]"]
  node_power_notebook["Powerball notebook<br/>[Powerball.ipynb]"]
end

subgraph group_workflow["Prediction workflow"]
  node_preprocessing["Data preprocessing"]
  node_lstm["LSTM training"]
  node_prediction["Prediction"]
end

subgraph group_data["Historical data"]
  node_mega_data["Mega Millions draws<br/>[megamillions.csv]"]
  node_power_data["Powerball draws<br/>[powerball.csv]"]
end

node_user(("Notebook user"))

node_user -->|"runs"| node_mega_notebook
node_user -->|"runs"| node_power_notebook
node_mega_data -->|"loads"| node_preprocessing
node_power_data -->|"loads"| node_preprocessing
node_mega_notebook -->|"performs"| node_preprocessing
node_power_notebook -->|"performs"| node_preprocessing
node_preprocessing -->|"prepares data"| node_lstm
node_lstm -->|"enables inference"| node_prediction

click node_mega_notebook "https://github.com/ahmad-alam/lottery-prediction/blob/main/MegaMillions.ipynb"
click node_power_notebook "https://github.com/ahmad-alam/lottery-prediction/blob/main/Powerball.ipynb"
click node_mega_data "https://github.com/ahmad-alam/lottery-prediction/blob/main/datasets/megamillions.csv"
click node_power_data "https://github.com/ahmad-alam/lottery-prediction/blob/main/datasets/powerball.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mega_notebook,node_power_notebook,node_user toneBlue
class node_preprocessing,node_lstm,node_prediction toneAmber
class node_mega_data,node_power_data toneMint
```

## Components

### Lottery projects

- [Mega Millions notebook](https://github.com/ahmad-alam/lottery-prediction/blob/main/MegaMillions.ipynb): `MegaMillions.ipynb`
- [Powerball notebook](https://github.com/ahmad-alam/lottery-prediction/blob/main/Powerball.ipynb): `Powerball.ipynb`

### Prediction workflow

- **Data preprocessing**
- **LSTM training**
- **Prediction**

### Historical data

- [Mega Millions draws](https://github.com/ahmad-alam/lottery-prediction/blob/main/datasets/megamillions.csv): `datasets/megamillions.csv`
- [Powerball draws](https://github.com/ahmad-alam/lottery-prediction/blob/main/datasets/powerball.csv): `datasets/powerball.csv`

### Other components

- **Notebook user**

## Connections

- Notebook user → Mega Millions notebook: runs (evidence: `README.md`)
- Notebook user → Powerball notebook: runs (evidence: `README.md`)
- Mega Millions draws → Data preprocessing: loads (evidence: `README.md`)
- Powerball draws → Data preprocessing: loads (evidence: `README.md`)
- Mega Millions notebook → Data preprocessing: performs (evidence: `README.md`)
- Powerball notebook → Data preprocessing: performs (evidence: `README.md`)
- Data preprocessing → LSTM training: prepares data (evidence: `README.md`)
- LSTM training → Prediction: enables inference (evidence: `README.md`)
