# debopriya-ai/climacast-dl architecture

> Architecture diagram of the GitHub repository debopriya-ai/climacast-dl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/debopriya-ai/climacast-dl
- Repository: https://github.com/debopriya-ai/climacast-dl

## Overview

##### Project Type and Purpose
- ClimaCast DL is a data-driven, full-stack machine-learning pipeline focused on multivariate time-series forecasting for climate variables using deep learning (LSTM, CNN, DNN).
- The project ingests a large climate dataset (Jena), preprocesses it, trains multiple DL models, evaluates performance, and visualizes results.

##### High-Level Architectural Components
a. Data Layer
- Raw Jena dataset files (CSV, NetCDF, etc.)
- Processed, windowed time-series stored in a local “data/” directory or as binary artifacts (NumPy arrays, TFRecords).
b. Preprocessing & Feature-Engineering Pipeline
- Python scripts/notebooks that perform temporal windowing, normalization, sequence generation (uses Pandas, NumPy).
c. Model Training & Experimentation
- “models/” folder with TensorFlow/Keras training scripts for LSTM, CNN, and Dense networks.
- Hyperparameter configurations, callbacks (Checkpoint, EarlyStopping).
d. Evaluation & Metrics
- Modules computing MAE, RMSE.
- Logging of results (CSV, TensorBoard).
e. Visualization & Reporting
- Jupyter notebooks in “notebooks/” for EDA, plotting prediction vs. ground truth (Matplotlib).
f. Deployment & Serving (Future/Optional)
- Exported SavedModel or HDF5 artifacts for inference in a production environment or API microservice.

##### Relationships and Data Flow
1. External Jena dataset → Data Layer
2. Data Layer → Preprocessing Pipeline → produces windowed tensors
3. Windowed tensors → Model Training → trained model artifacts
4. Trained models + validation data → Evaluation Module → metrics
5. Evaluation outputs + sample predictions → Visualization Notebook → charts & insights
6. Final model → Deployment packaging (SavedModel)

##### Architectural Patterns & Design Principles
- Modular separation of concerns: data ingestion, preprocessing, training, evaluation, and visualization are in distinct directories.
- Pipeline-oriented workflow: each step takes the output from the previous and feeds the next (akin to ETL).
- Experiment management: separate sub-folders or scripts per model type to allow easy comparisons (LSTM vs. CNN vs. DNN).
- Reproducibility: use of fixed random seeds, checkpoint callbacks, and versioned data artifacts.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Layer"
        Jena[(Jena Dataset)]:::data
        Raw["Raw Data (CSV, NetCDF)"]:::data
        Proc["Processed Data (NumPy arrays, TFRecords)"]:::data
        subgraph "Documentation"
            README["README.md"]:::doc
            LICENSE["LICENSE"]:::doc
        end
    end

    subgraph "Compute Layer"
        Preprocess["preprocessing.py\n(windowing, normalization)"]:::compute
        subgraph "Model Training"
            LSTM["train_lstm.py\n(LSTM Model)"]:::compute
            CNN["train_cnn.py\n(CNN Model)"]:::compute
            DNN["train_dnn.py\n(Dense Model)"]:::compute
        end
        Eval["metrics.py\n(Evaluation Module)"]:::metrics
        Deploy["SavedModel Export"]:::compute
        API["Serving API"]:::compute
    end

    subgraph "User Interaction"
        Notebook["Time_Series_Lab_Solution (1).ipynb"]:::notebook
    end

    Jena -->|"ingest"| Raw
    Raw -->|"CSV → NumPy array"| Proc
    Proc -->|"windowed tensor batch"| Preprocess
    Preprocess -->|"TFRecord"| LSTM
    Preprocess -->|"TFRecord"| CNN
    Preprocess -->|"TFRecord"| DNN
    LSTM -->|"Model HDF5"| Eval
    CNN -->|"Model HDF5"| Eval
    DNN -->|"Model HDF5"| Eval
    Eval -->|"Metrics CSV, TensorBoard logs"| Notebook
    LSTM -->|"SavedModel"| Deploy
    Deploy -->|"REST endpoint"| API
    API -->|"Predictions"| Notebook

    click Notebook "https://github.com/debopriya-ai/climacast-dl/blob/main/Time_Series_Lab_Solution (1).ipynb"
    click README "https://github.com/debopriya-ai/climacast-dl/blob/main/README.md"
    click LICENSE "https://github.com/debopriya-ai/climacast-dl/tree/main/LICENSE"

    classDef data fill:#AED6F1,stroke:#3498DB,color:#1B4F72
    classDef compute fill:#A9DFBF,stroke:#27AE60,color:#145A32
    classDef metrics fill:#F9E79F,stroke:#F1C40F,color:#7D6608
    classDef notebook fill:#D2B4DE,stroke:#8E44AD,color:#4A235A
    classDef doc fill:#D6DBDF,stroke:#566573,color:#1C2833
```
