# rugved0014/buyer-segmentation-and-investment-profiling- architecture

> Architecture diagram of the GitHub repository rugved0014/buyer-segmentation-and-investment-profiling-, 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/rugved0014/buyer-segmentation-and-investment-profiling-
- Repository: https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-

## Overview

This is a real-estate buyer segmentation and investment-profiling project. Its main workflow cleans client and property records, engineers transaction behavior, clusters and labels buyers, then presents segment and client-level insights in a filterable Streamlit dashboard. The README also describes model validation and exploratory analysis. Pipeline and dashboard excerpts support the main stages; dashboard loading details are partly omitted, so the graph shows only the documented artifact-to-dashboard relationship.

Main entry points: [`streamlit_app.py`](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py) (Streamlit Dashboard), [`02_clustering.py`](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/02_clustering.py) (Feature Scaling), [`data/clients_clustered.csv`](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/data/clients_clustered.csv) (Labeled Clients), [`01_clean_and_engineer.py`](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/01_clean_and_engineer.py) (Clean and Engineer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data Preparation"]
  node_clientdata["Client Records"]
  node_propertydata["Property Records"]
  node_clean["Clean and Engineer"]
  node_features["Client Features"]
end

subgraph group_analysis["Segmentation Analysis"]
  node_matrix["Feature Scaling<br/>[02_clustering.py]"]
  node_selection["Cluster Validation<br/>[02_clustering.py]"]
  node_kmeans["K-Means Segments<br/>[02_clustering.py]"]
  node_profile["Segment Profiles"]
  node_clusterdata["Labeled Clients"]
  node_summary["Model Summary"]
  node_eda["Exploratory Analysis<br/>[03_eda_extra.py]"]
end

subgraph group_insights["Buyer Insights"]
  node_dashboard["Streamlit Dashboard<br/>[streamlit_app.py]"]
  node_overview["Segment Overview<br/>[streamlit_app.py]"]
  node_behavior["Behavior Analysis<br/>[streamlit_app.py]"]
  node_geography["Geographic Analysis<br/>[streamlit_app.py]"]
  node_playbooks["Segment Playbooks<br/>[streamlit_app.py]"]
  node_explorer["Client Explorer<br/>[streamlit_app.py]"]
end

node_analyst(("Analyst"))

node_analyst -->|"opens"| node_dashboard
node_clientdata -->|"reads"| node_clean
node_propertydata -->|"reads"| node_clean
node_clean -->|"writes"| node_features
node_features -->|"reads"| node_matrix
node_matrix -->|"evaluates"| node_selection
node_matrix -->|"clusters"| node_kmeans
node_selection -->|"writes"| node_summary
node_kmeans -->|"labels"| node_clusterdata
node_kmeans -->|"summarizes"| node_profile
node_clusterdata -->|"reads"| node_eda
node_clusterdata -->|"loads"| node_dashboard
node_profile -->|"loads"| node_dashboard
node_dashboard -->|"renders"| node_overview
node_dashboard -->|"renders"| node_behavior
node_dashboard -->|"renders"| node_geography
node_dashboard -->|"renders"| node_playbooks
node_dashboard -->|"renders"| node_explorer

click node_clean "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/01_clean_and_engineer.py"
click node_features "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/data/client_features.csv"
click node_matrix "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/02_clustering.py"
click node_selection "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/02_clustering.py"
click node_kmeans "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/02_clustering.py"
click node_profile "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/outputs/cluster_profile.csv"
click node_clusterdata "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/data/clients_clustered.csv"
click node_summary "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/outputs/clustering_summary.txt"
click node_eda "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/03_eda_extra.py"
click node_dashboard "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py"
click node_overview "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py"
click node_behavior "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py"
click node_geography "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py"
click node_playbooks "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py"
click node_explorer "https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_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_clientdata,node_propertydata,node_clean,node_features toneBlue
class node_matrix,node_selection,node_kmeans,node_profile,node_clusterdata,node_summary,node_eda toneAmber
class node_dashboard,node_overview,node_behavior,node_geography,node_playbooks,node_explorer toneMint
class node_analyst toneIndigo
```

## Components

### Data Preparation

- **Client Records**
- **Property Records**
- [Clean and Engineer](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/01_clean_and_engineer.py): `01_clean_and_engineer.py`
- [Client Features](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/data/client_features.csv): `data/client_features.csv`

### Segmentation Analysis

- [Feature Scaling](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/02_clustering.py): `02_clustering.py`
- [Cluster Validation](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/02_clustering.py): `02_clustering.py`
- [K-Means Segments](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/02_clustering.py): `02_clustering.py`
- [Segment Profiles](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/outputs/cluster_profile.csv): `outputs/cluster_profile.csv`
- [Labeled Clients](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/data/clients_clustered.csv): `data/clients_clustered.csv`
- [Model Summary](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/outputs/clustering_summary.txt): `outputs/clustering_summary.txt`
- [Exploratory Analysis](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/03_eda_extra.py): `03_eda_extra.py`

### Buyer Insights

- [Streamlit Dashboard](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py): `streamlit_app.py`
- [Segment Overview](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py): `streamlit_app.py`
- [Behavior Analysis](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py): `streamlit_app.py`
- [Geographic Analysis](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py): `streamlit_app.py`
- [Segment Playbooks](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py): `streamlit_app.py`
- [Client Explorer](https://github.com/rugved0014/buyer-segmentation-and-investment-profiling-/blob/main/streamlit_app.py): `streamlit_app.py`

### Other components

- **Analyst**

## Connections

- Analyst → Streamlit Dashboard: opens
- Client Records → Clean and Engineer: reads
- Property Records → Clean and Engineer: reads
- Clean and Engineer → Client Features: writes
- Client Features → Feature Scaling: reads
- Feature Scaling → Cluster Validation: evaluates
- Feature Scaling → K-Means Segments: clusters
- Cluster Validation → Model Summary: writes
- K-Means Segments → Labeled Clients: labels
- K-Means Segments → Segment Profiles: summarizes
- Labeled Clients → Exploratory Analysis: reads
- Labeled Clients → Streamlit Dashboard: loads
- Segment Profiles → Streamlit Dashboard: loads
- Streamlit Dashboard → Segment Overview: renders
- Streamlit Dashboard → Behavior Analysis: renders
- Streamlit Dashboard → Geographic Analysis: renders
- Streamlit Dashboard → Segment Playbooks: renders
- Streamlit Dashboard → Client Explorer: renders
