# nagendraseelam/retail-customer-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/nagendraseelam/retail-customer-intelligence
- Repository: https://github.com/nagendraseelam/retail-customer-intelligence

## Overview

The repository is a retail customer-intelligence project: a notebook documents transaction analysis, RFM segmentation, and high-value prediction, while a Streamlit app accepts customer metrics and returns a prediction with probability. The README documents the notebook’s analysis and modeling stages; only the app source was sampled, so notebook-stage connections rely on README statements rather than inspected implementation.

Main entry points: [`Retail_Customer_Intelligence.ipynb`](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb) (Data Cleaning), [`app.py`](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/app.py) (Streamlit Input), [`xgboost_high_value_model.pkl`](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/xgboost_high_value_model.pkl) (XGBoost Model), [`features.pkl`](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/features.pkl) (Feature Names)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Business Analysis"]
  node_cleaning["Data Cleaning"]
  node_business_analysis["Business KPIs and EDA"]
end

subgraph group_segments["Customer Segmentation"]
  node_rfm["RFM Analysis"]
  node_clustering["K-Means Segments"]
end

subgraph group_prediction["Value Prediction"]
  node_customer_features["Customer Features"]
  node_model_training["Model Training and Evaluation"]
  node_model_artifact["XGBoost Model"]
  node_feature_artifact["Feature Names<br/>[features.pkl]"]
end

subgraph group_serving["Prediction App"]
  node_streamlit_app["Streamlit Input<br/>[app.py]"]
  node_prediction_result["Prediction and Probability<br/>[app.py]"]
end

node_retail_data[("Online Retail Data")]
node_customer(("Business User"))

node_retail_data -->|"provides transactions"| node_cleaning
node_cleaning -->|"prepares data for"| node_business_analysis
node_cleaning -->|"prepares data for"| node_rfm
node_rfm -->|"clusters customers"| node_clustering
node_cleaning -->|"supports feature creation"| node_customer_features
node_customer_features -->|"trains and evaluates"| node_model_training
node_model_training -->|"serializes model"| node_model_artifact
node_customer_features -.->|"provides feature names"| node_feature_artifact
node_customer -->|"enters customer metrics"| node_streamlit_app
node_streamlit_app -->|"loads model"| node_model_artifact
node_streamlit_app -->|"loads feature names"| node_feature_artifact
node_streamlit_app -->|"predicts and displays"| node_prediction_result

click node_cleaning "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb"
click node_business_analysis "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb"
click node_rfm "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb"
click node_clustering "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb"
click node_customer_features "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb"
click node_model_training "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb"
click node_model_artifact "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/xgboost_high_value_model.pkl"
click node_feature_artifact "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/features.pkl"
click node_streamlit_app "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/app.py"
click node_prediction_result "https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/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_cleaning,node_business_analysis,node_customer toneBlue
class node_rfm,node_clustering,node_retail_data toneAmber
class node_customer_features,node_model_training,node_model_artifact,node_feature_artifact toneMint
class node_streamlit_app,node_prediction_result toneRose
```

## Components

### Business Analysis

- [Data Cleaning](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb): `Retail_Customer_Intelligence.ipynb`
- [Business KPIs and EDA](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb): `Retail_Customer_Intelligence.ipynb`

### Customer Segmentation

- [RFM Analysis](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb): `Retail_Customer_Intelligence.ipynb`
- [K-Means Segments](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb): `Retail_Customer_Intelligence.ipynb`

### Value Prediction

- [Customer Features](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb): `Retail_Customer_Intelligence.ipynb`
- [Model Training and Evaluation](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/Retail_Customer_Intelligence.ipynb): `Retail_Customer_Intelligence.ipynb`
- [XGBoost Model](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/xgboost_high_value_model.pkl): `xgboost_high_value_model.pkl`
- [Feature Names](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/features.pkl): `features.pkl`

### Prediction App

- [Streamlit Input](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/app.py): `app.py`
- [Prediction and Probability](https://github.com/nagendraseelam/retail-customer-intelligence/blob/main/app.py): `app.py`

### Other components

- **Online Retail Data**
- **Business User**

## Connections

- Online Retail Data → Data Cleaning: provides transactions (evidence: `README.md`)
- Data Cleaning → Business KPIs and EDA: prepares data for (evidence: `README.md`)
- Data Cleaning → RFM Analysis: prepares data for (evidence: `README.md`)
- RFM Analysis → K-Means Segments: clusters customers (evidence: `README.md`)
- Data Cleaning → Customer Features: supports feature creation (evidence: `README.md`)
- Customer Features → Model Training and Evaluation: trains and evaluates (evidence: `README.md`)
- Model Training and Evaluation → XGBoost Model: serializes model (evidence: `README.md`)
- Customer Features → Feature Names: provides feature names
- Business User → Streamlit Input: enters customer metrics (evidence: `README.md`)
- Streamlit Input → XGBoost Model: loads model (evidence: `app.py`)
- Streamlit Input → Feature Names: loads feature names (evidence: `app.py`)
- Streamlit Input → Prediction and Probability: predicts and displays (evidence: `app.py`)
