# sivaprakash2k3/aqi-prediction-project architecture

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

- Interactive diagram: https://gitdiagram.com/sivaprakash2k3/aqi-prediction-project
- Repository: https://github.com/sivaprakash2k3/aqi-prediction-project

## Overview

This is a single-script AQI forecasting project: a user runs the script, which loads pollution history, prepares features, trains and evaluates tabular and sequence models, plots predictions, and saves selected models. The README documents all model variants and outputs; the excerpt shows representative preprocessing, model training, evaluation, plotting, and saving. The script is presented as a Colab workflow using Google Drive. Gaps in the excerpt limit evidence for some individual model links, so documented capabilities are included without asserting unshown implementation details.

Main entry points: [`aqi_prediction_project.py`](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py) (Forecast metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_load["Load dataset"]
  node_prepare["Clean and features"]
  node_tabular["Tabular split and scale"]
  node_sequences["24-hour sequences"]
end

subgraph group_ml["Machine learning"]
  node_rf["Random Forest"]
  node_xgb["XGBoost"]
  node_lgbm["LightGBM"]
  node_catboost["CatBoost"]
end

subgraph group_dl["Deep learning"]
  node_lstm["LSTM"]
  node_gru["GRU"]
  node_stacked_gru["Stacked GRU"]
  node_cnn_lstm["CNN + LSTM"]
end

subgraph group_results["Evaluation and outputs"]
  node_metrics["Forecast metrics"]
  node_plots["Actual vs predicted plots"]
  node_saved["Saved models and scaler"]
end

node_user(("Project user"))
node_drive["Google Drive"]
node_history["Historical AQI data"]

node_user -->|"runs"| node_load
node_drive -->|"provides dataset"| node_load
node_history -->|"read from"| node_load
node_load -->|"prepares data"| node_prepare
node_prepare -->|"scales and splits"| node_tabular
node_prepare -->|"builds sequences"| node_sequences
node_tabular -->|"trains and predicts"| node_rf
node_tabular -->|"trains and predicts"| node_xgb
node_tabular -->|"trains and predicts"| node_lgbm
node_tabular -->|"trains and predicts"| node_catboost
node_sequences -->|"trains and predicts"| node_lstm
node_sequences -->|"trains and predicts"| node_gru
node_sequences -->|"trains and predicts"| node_stacked_gru
node_sequences -->|"trains and predicts"| node_cnn_lstm
node_rf -->|"evaluated by"| node_metrics
node_xgb -.->|"evaluated by"| node_metrics
node_lgbm -->|"evaluated by"| node_metrics
node_catboost -->|"evaluated by"| node_metrics
node_gru -->|"evaluated by"| node_metrics
node_lstm -->|"evaluated by"| node_metrics
node_stacked_gru -.->|"evaluated by"| node_metrics
node_cnn_lstm -.->|"evaluated by"| node_metrics
node_metrics -->|"plots predictions"| node_plots
node_gru -->|"saves model"| node_saved
node_lstm -->|"saves model"| node_saved
node_stacked_gru -->|"saves model"| node_saved
node_cnn_lstm -->|"saves model"| node_saved
node_catboost -.->|"saves model"| node_saved
node_drive -->|"stores artifacts"| node_saved

click node_load "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_prepare "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_tabular "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_sequences "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_rf "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_xgb "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_lgbm "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_catboost "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_lstm "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_gru "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_stacked_gru "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_cnn_lstm "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_metrics "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_plots "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"
click node_saved "https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py"

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_load,node_prepare,node_tabular,node_sequences,node_user toneBlue
class node_rf,node_xgb,node_lgbm,node_catboost toneAmber
class node_lstm,node_gru,node_stacked_gru,node_cnn_lstm toneMint
class node_metrics,node_plots,node_saved toneRose
class node_drive,node_history toneIndigo
```

## Components

### Data preparation

- [Load dataset](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [Clean and features](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [Tabular split and scale](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [24-hour sequences](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`

### Machine learning

- [Random Forest](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [XGBoost](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [LightGBM](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [CatBoost](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`

### Deep learning

- [LSTM](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [GRU](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [Stacked GRU](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [CNN + LSTM](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`

### Evaluation and outputs

- [Forecast metrics](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [Actual vs predicted plots](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`
- [Saved models and scaler](https://github.com/sivaprakash2k3/aqi-prediction-project/blob/master/aqi_prediction_project.py): `aqi_prediction_project.py`

### Other components

- **Project user**
- **Google Drive**
- **Historical AQI data**

## Connections

- Project user → Load dataset: runs (evidence: `README.md`)
- Google Drive → Load dataset: provides dataset (evidence: `aqi_prediction_project.py`)
- Historical AQI data → Load dataset: read from (evidence: `aqi_prediction_project.py`)
- Load dataset → Clean and features: prepares data (evidence: `aqi_prediction_project.py`)
- Clean and features → Tabular split and scale: scales and splits (evidence: `aqi_prediction_project.py`)
- Clean and features → 24-hour sequences: builds sequences (evidence: `aqi_prediction_project.py`)
- Tabular split and scale → Random Forest: trains and predicts (evidence: `aqi_prediction_project.py`)
- Tabular split and scale → XGBoost: trains and predicts (evidence: `aqi_prediction_project.py`)
- Tabular split and scale → LightGBM: trains and predicts (evidence: `aqi_prediction_project.py`)
- Tabular split and scale → CatBoost: trains and predicts (evidence: `aqi_prediction_project.py`)
- 24-hour sequences → LSTM: trains and predicts (evidence: `README.md`)
- 24-hour sequences → GRU: trains and predicts (evidence: `aqi_prediction_project.py`)
- 24-hour sequences → Stacked GRU: trains and predicts (evidence: `aqi_prediction_project.py`)
- 24-hour sequences → CNN + LSTM: trains and predicts (evidence: `aqi_prediction_project.py`)
- Random Forest → Forecast metrics: evaluated by (evidence: `aqi_prediction_project.py`)
- XGBoost → Forecast metrics: evaluated by (evidence: `README.md`)
- LightGBM → Forecast metrics: evaluated by (evidence: `aqi_prediction_project.py`)
- CatBoost → Forecast metrics: evaluated by (evidence: `aqi_prediction_project.py`)
- GRU → Forecast metrics: evaluated by (evidence: `aqi_prediction_project.py`)
- LSTM → Forecast metrics: evaluated by (evidence: `aqi_prediction_project.py`)
- Stacked GRU → Forecast metrics: evaluated by (evidence: `README.md`)
- CNN + LSTM → Forecast metrics: evaluated by (evidence: `README.md`)
- Forecast metrics → Actual vs predicted plots: plots predictions (evidence: `aqi_prediction_project.py`)
- GRU → Saved models and scaler: saves model (evidence: `aqi_prediction_project.py`)
- LSTM → Saved models and scaler: saves model (evidence: `aqi_prediction_project.py`)
- Stacked GRU → Saved models and scaler: saves model (evidence: `aqi_prediction_project.py`)
- CNN + LSTM → Saved models and scaler: saves model (evidence: `aqi_prediction_project.py`)
- CatBoost → Saved models and scaler: saves model (evidence: `README.md`)
- Google Drive → Saved models and scaler: stores artifacts (evidence: `aqi_prediction_project.py`)
