# pooja30-ux/weather-predection-system architecture

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

- Interactive diagram: https://gitdiagram.com/pooja30-ux/weather-predection-system
- Repository: https://github.com/pooja30-ux/weather-predection-system

## Overview

This repository is a weather-temperature prediction project: Python scripts train and evaluate a Random Forest model, and a Flask endpoint accepts weather features and returns a temperature prediction. The request path is visible in app.py; both training scripts save the model artifact. The API also loads scaler.pkl, which is absent from the supplied tree, and no scaler-training flow is shown. HTML/CSS files are present, but their contents and integration are not evidenced by the sampled source.

Main entry points: [`app.py`](https://github.com/pooja30-ux/weather-predection-system/blob/main/app.py) (Flask API), [`temperature_model.pkl`](https://github.com/pooja30-ux/weather-predection-system/blob/main/temperature_model.pkl) (Random Forest), [`train.py`](https://github.com/pooja30-ux/weather-predection-system/blob/main/train.py) (Training and evaluation), [`weather.py`](https://github.com/pooja30-ux/weather-predection-system/blob/main/weather.py) (Cleaned training pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serving["Prediction API"]
  node_api["Flask API<br/>[app.py]"]
  node_scaler["Feature scaler"]
  node_model["Random Forest"]
  node_response["Temperature result<br/>[app.py]"]
end

subgraph group_training["Model Training"]
  node_train_basic["Training and evaluation<br/>[train.py]"]
  node_train_improved["Cleaned training pipeline<br/>[weather.py]"]
end

node_caller(("Prediction client"))
node_training_data["Weather dataset"]

node_caller -->|"sends features"| node_api
node_api -->|"scales input"| node_scaler
node_api -->|"predicts with"| node_model
node_api -->|"returns prediction"| node_response
node_training_data -->|"loads data"| node_train_basic
node_train_basic -->|"saves model"| node_model
node_training_data -->|"loads data"| node_train_improved
node_train_improved -->|"saves model"| node_model

click node_api "https://github.com/pooja30-ux/weather-predection-system/blob/main/app.py"
click node_model "https://github.com/pooja30-ux/weather-predection-system/blob/main/temperature_model.pkl"
click node_response "https://github.com/pooja30-ux/weather-predection-system/blob/main/app.py"
click node_train_basic "https://github.com/pooja30-ux/weather-predection-system/blob/main/train.py"
click node_train_improved "https://github.com/pooja30-ux/weather-predection-system/blob/main/weather.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_api,node_scaler,node_model,node_response,node_caller toneBlue
class node_train_basic,node_train_improved toneAmber
class node_training_data toneIndigo
```

## Components

### Prediction API

- [Flask API](https://github.com/pooja30-ux/weather-predection-system/blob/main/app.py): `app.py`
- **Feature scaler**
- [Random Forest](https://github.com/pooja30-ux/weather-predection-system/blob/main/temperature_model.pkl): `temperature_model.pkl`
- [Temperature result](https://github.com/pooja30-ux/weather-predection-system/blob/main/app.py): `app.py`

### Model Training

- [Training and evaluation](https://github.com/pooja30-ux/weather-predection-system/blob/main/train.py): `train.py`
- [Cleaned training pipeline](https://github.com/pooja30-ux/weather-predection-system/blob/main/weather.py): `weather.py`

### Other components

- **Prediction client**
- **Weather dataset**

## Connections

- Prediction client → Flask API: sends features
- Flask API → Feature scaler: scales input
- Flask API → Random Forest: predicts with
- Flask API → Temperature result: returns prediction
- Weather dataset → Training and evaluation: loads data
- Training and evaluation → Random Forest: saves model
- Weather dataset → Cleaned training pipeline: loads data
- Cleaned training pipeline → Random Forest: saves model
