# priyapaldatahub/weather-forecaster-ml architecture

> Architecture diagram of the GitHub repository priyapaldatahub/weather-forecaster-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/priyapaldatahub/weather-forecaster-ml
- Repository: https://github.com/priyapaldatahub/weather-forecaster-ml

## Overview

This is a weather-temperature regression project: it explores and prepares historical climate data, trains and evaluates a Random Forest model, saves the model and feature mappings, and serves predictions through Streamlit. The main user path is weather inputs → prediction in the app → displayed temperature. Source excerpts show training invoking preprocessing and the app loading saved artifacts; README statements support the broader documented workflow. The README’s Parquet dataset is not present in the listed tree, so dataset links reflect documented inputs rather than a verified checked-in file.

Main entry points: [`src/app.py`](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/app.py) (Input interface), [`src/train.py`](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/train.py) (Train and evaluate), [`src/datacollection.py`](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/datacollection.py) (Dataset loader), [`src/preprocessing.py`](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/preprocessing.py) (Clean and engineer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data exploration"]
  node_collector["Dataset loader<br/>[datacollection.py]"]
  node_eda["Weather analysis<br/>[EDA.py]"]
end

subgraph group_prep["Data preparation"]
  node_preprocess["Clean and engineer<br/>[preprocessing.py]"]
end

subgraph group_model["Model training"]
  node_trainer["Train and evaluate<br/>[train.py]"]
  node_artifacts["Model artifacts<br/>[weather_model.pkl]"]
  node_mappings["Feature mappings"]
end

subgraph group_serve["Prediction app"]
  node_interface["Input interface<br/>[app.py]"]
  node_predict["Temperature prediction<br/>[app.py]"]
end

node_weather_source[("Historical weather data")]
node_user(("Weather user"))
node_result["Predicted temperature"]

node_weather_source -->|"loads dataset"| node_collector
node_weather_source -->|"analyzes data"| node_eda
node_weather_source -->|"loads data"| node_preprocess
node_collector -->|"returns data"| node_weather_source
node_trainer -->|"calls cleaning"| node_preprocess
node_trainer -->|"saves model"| node_artifacts
node_trainer -->|"saves columns"| node_mappings
node_user -->|"enters weather"| node_interface
node_interface -->|"loads model"| node_artifacts
node_interface -->|"loads mappings"| node_mappings
node_interface -->|"submits inputs"| node_predict
node_predict -->|"displays temperature"| node_result

click node_collector "https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/datacollection.py"
click node_eda "https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/EDA.py"
click node_preprocess "https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/preprocessing.py"
click node_trainer "https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/train.py"
click node_artifacts "https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/models/weather_model.pkl"
click node_mappings "https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/models/feature_columns.pkl"
click node_interface "https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/app.py"
click node_predict "https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/app.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_collector,node_eda,node_user toneBlue
class node_preprocess,node_weather_source toneAmber
class node_trainer,node_artifacts,node_mappings toneMint
class node_interface,node_predict toneRose
class node_result toneIndigo
```

## Components

### Data exploration

- [Dataset loader](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/datacollection.py): `src/datacollection.py`
- [Weather analysis](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/EDA.py): `src/EDA.py`

### Data preparation

- [Clean and engineer](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/preprocessing.py): `src/preprocessing.py`

### Model training

- [Train and evaluate](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/train.py): `src/train.py`
- [Model artifacts](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/models/weather_model.pkl): `models/weather_model.pkl`
- [Feature mappings](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/models/feature_columns.pkl): `models/feature_columns.pkl`

### Prediction app

- [Input interface](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/app.py): `src/app.py`
- [Temperature prediction](https://github.com/priyapaldatahub/weather-forecaster-ml/blob/main/src/app.py): `src/app.py`

### Other components

- **Historical weather data**
- **Weather user**
- **Predicted temperature**

## Connections

- Historical weather data → Dataset loader: loads dataset (evidence: `src/datacollection.py`)
- Historical weather data → Weather analysis: analyzes data (evidence: `src/EDA.py`)
- Historical weather data → Clean and engineer: loads data (evidence: `src/preprocessing.py`)
- Dataset loader → Historical weather data: returns data (evidence: `src/datacollection.py`)
- Train and evaluate → Clean and engineer: calls cleaning (evidence: `src/train.py`)
- Train and evaluate → Model artifacts: saves model (evidence: `src/train.py`)
- Train and evaluate → Feature mappings: saves columns (evidence: `src/train.py`)
- Weather user → Input interface: enters weather (evidence: `README.md`)
- Input interface → Model artifacts: loads model (evidence: `src/app.py`)
- Input interface → Feature mappings: loads mappings (evidence: `src/app.py`)
- Input interface → Temperature prediction: submits inputs (evidence: `src/app.py`)
- Temperature prediction → Predicted temperature: displays temperature (evidence: `src/app.py`)
