# fathanjanuu/online-retail-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/fathanjanuu/online-retail-analysis
- Repository: https://github.com/fathanjanuu/online-retail-analysis

## Overview

This repository is a notebook-based analysis of UK online-retail transactions, answering which customers are valuable or at risk through RFM and K-Means segmentation. Its workflow moves from raw-data understanding and cleaning to customer features, exploration, and segments, with charts and tables as report outputs. The README documents the notebook order and major capabilities; notebook source was not sampled, so links below reflect documented data flow rather than inspected calls.

Main entry points: [`data/raw`](https://github.com/fathanjanuu/online-retail-analysis/tree/main/data/raw) (Raw transactions), [`data/processed`](https://github.com/fathanjanuu/online-retail-analysis/tree/main/data/processed) (Clean sales tables), [`notebooks/02_data_cleaning.ipynb`](https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/02_data_cleaning.ipynb) (Data cleaning), [`notebooks/03_feature_engineering.ipynb`](https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/03_feature_engineering.ipynb) (RFM features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_preparation["Data preparation"]
  node_raw["Raw transactions"]
  node_understanding["Data understanding"]
  node_cleaning["Data cleaning"]
  node_clean_sales["Clean sales tables"]
end

subgraph group_analysis["Customer analysis"]
  node_rfm["RFM features"]
  node_rfm_data["Customer RFM table"]
  node_eda["Exploratory analysis<br/>[04_eda.ipynb]"]
  node_segmentation["Customer segmentation"]
end

subgraph group_outputs["Results"]
  node_reports["Charts and profiles"]
end

node_uci(("UCI dataset"))

node_uci -->|"provides data"| node_raw
node_raw -->|"examines"| node_understanding
node_raw -->|"cleans"| node_cleaning
node_cleaning -->|"saves tables"| node_clean_sales
node_clean_sales -->|"provides sales"| node_rfm
node_rfm -->|"creates table"| node_rfm_data
node_clean_sales -->|"explores"| node_eda
node_rfm_data -->|"segments customers"| node_segmentation
node_eda -->|"produces charts"| node_reports
node_segmentation -->|"produces profiles"| node_reports

click node_raw "https://github.com/fathanjanuu/online-retail-analysis/tree/main/data/raw"
click node_understanding "https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/01_data_understanding.ipynb"
click node_cleaning "https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/02_data_cleaning.ipynb"
click node_clean_sales "https://github.com/fathanjanuu/online-retail-analysis/tree/main/data/processed"
click node_rfm "https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/03_feature_engineering.ipynb"
click node_rfm_data "https://github.com/fathanjanuu/online-retail-analysis/tree/main/data/processed"
click node_eda "https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/04_eda.ipynb"
click node_segmentation "https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/05_segmentation.ipynb"
click node_reports "https://github.com/fathanjanuu/online-retail-analysis/tree/main/reports"

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_raw,node_understanding,node_cleaning,node_clean_sales toneBlue
class node_rfm,node_rfm_data,node_eda,node_segmentation toneAmber
class node_reports toneMint
class node_uci toneIndigo
```

## Components

### Data preparation

- [Raw transactions](https://github.com/fathanjanuu/online-retail-analysis/tree/main/data/raw): `data/raw`
- [Data understanding](https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/01_data_understanding.ipynb): `notebooks/01_data_understanding.ipynb`
- [Data cleaning](https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/02_data_cleaning.ipynb): `notebooks/02_data_cleaning.ipynb`
- [Clean sales tables](https://github.com/fathanjanuu/online-retail-analysis/tree/main/data/processed): `data/processed`

### Customer analysis

- [RFM features](https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/03_feature_engineering.ipynb): `notebooks/03_feature_engineering.ipynb`
- [Customer RFM table](https://github.com/fathanjanuu/online-retail-analysis/tree/main/data/processed): `data/processed`
- [Exploratory analysis](https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/04_eda.ipynb): `notebooks/04_eda.ipynb`
- [Customer segmentation](https://github.com/fathanjanuu/online-retail-analysis/blob/main/notebooks/05_segmentation.ipynb): `notebooks/05_segmentation.ipynb`

### Results

- [Charts and profiles](https://github.com/fathanjanuu/online-retail-analysis/tree/main/reports): `reports`

### Other components

- **UCI dataset**

## Connections

- UCI dataset → Raw transactions: provides data (evidence: `README.md`)
- Raw transactions → Data understanding: examines (evidence: `README.md`)
- Raw transactions → Data cleaning: cleans (evidence: `README.md`)
- Data cleaning → Clean sales tables: saves tables (evidence: `README.md`)
- Clean sales tables → RFM features: provides sales (evidence: `README.md`)
- RFM features → Customer RFM table: creates table (evidence: `README.md`)
- Clean sales tables → Exploratory analysis: explores (evidence: `README.md`)
- Customer RFM table → Customer segmentation: segments customers (evidence: `README.md`)
- Exploratory analysis → Charts and profiles: produces charts (evidence: `README.md`)
- Customer segmentation → Charts and profiles: produces profiles (evidence: `README.md`)
