# ranjeetchauhan0805/retail-sales-and-demand-forecaster architecture

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

- Interactive diagram: https://gitdiagram.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster
- Repository: https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster

## Overview

This is a retail transaction quantity-prediction project: users enter transaction, location, and date details in the Streamlit app and receive a predicted quantity with a summary. The README documents an offline workflow from transaction data through preprocessing, feature engineering, model comparison, and saved-model deployment. Notebook implementation details were not sampled, so those workflow links reflect README documentation; the app’s input, model loading, prediction, and display flow is supported by app.py.

Main entry points: [`app.py`](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/app.py) (Quantity inference), [`notebook/EDA.ipynb`](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb) (Exploration), [`models/gradient_boosting_model.pkl`](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/models/gradient_boosting_model.pkl) (Gradient Boosting model), [`data/Sales Dataset.csv`](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/data/Sales%20Dataset.csv) (Sales transactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Prediction app"]
  node_entry["Transaction entry<br/>[app.py]"]
  node_inference["Quantity inference<br/>[app.py]"]
  node_results["Prediction and metrics<br/>[app.py]"]
end

subgraph group_development["Model development"]
  node_eda["Exploration<br/>[EDA.ipynb]"]
  node_preprocessing["Preparation and features<br/>[EDA.ipynb]"]
  node_training["Regression training<br/>[EDA.ipynb]"]
  node_validation["Chronological validation<br/>[EDA.ipynb]"]
  node_comparison["Model evaluation<br/>[EDA.ipynb]"]
end

subgraph group_artifacts["Data and artifacts"]
  node_source_data["Sales transactions<br/>[Sales Dataset.csv]"]
  node_model["Gradient Boosting model"]
end

node_user(("User"))

node_user -->|"enters details"| node_entry
node_entry -->|"submits features"| node_inference
node_inference -->|"loads and predicts"| node_model
node_inference -->|"displays prediction"| node_results
node_source_data -->|"analyzed in"| node_eda
node_eda -->|"informs"| node_preprocessing
node_preprocessing -->|"prepares features"| node_training
node_training -->|"evaluated with"| node_validation
node_validation -->|"compared in"| node_comparison
node_comparison -->|"saves selected model"| node_model

click node_entry "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/app.py"
click node_inference "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/app.py"
click node_results "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/app.py"
click node_source_data "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/data/Sales%20Dataset.csv"
click node_eda "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb"
click node_preprocessing "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb"
click node_training "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb"
click node_validation "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb"
click node_comparison "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb"
click node_model "https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/models/gradient_boosting_model.pkl"

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_entry,node_inference,node_results,node_user toneBlue
class node_eda,node_preprocessing,node_training,node_validation,node_comparison toneAmber
class node_source_data,node_model toneMint
```

## Components

### Prediction app

- [Transaction entry](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/app.py): `app.py`
- [Quantity inference](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/app.py): `app.py`
- [Prediction and metrics](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/app.py): `app.py`

### Model development

- [Exploration](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb): `notebook/EDA.ipynb`
- [Preparation and features](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb): `notebook/EDA.ipynb`
- [Regression training](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb): `notebook/EDA.ipynb`
- [Chronological validation](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb): `notebook/EDA.ipynb`
- [Model evaluation](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/notebook/EDA.ipynb): `notebook/EDA.ipynb`

### Data and artifacts

- [Sales transactions](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/data/Sales%20Dataset.csv): `data/Sales Dataset.csv`
- [Gradient Boosting model](https://github.com/ranjeetchauhan0805/retail-sales-and-demand-forecaster/blob/main/models/gradient_boosting_model.pkl): `models/gradient_boosting_model.pkl`

### Other components

- **User**

## Connections

- User → Transaction entry: enters details
- Transaction entry → Quantity inference: submits features
- Quantity inference → Gradient Boosting model: loads and predicts
- Quantity inference → Prediction and metrics: displays prediction
- Sales transactions → Exploration: analyzed in
- Exploration → Preparation and features: informs
- Preparation and features → Regression training: prepares features
- Regression training → Chronological validation: evaluated with
- Chronological validation → Model evaluation: compared in
- Model evaluation → Gradient Boosting model: saves selected model
