Skip to content

An interactive dashboard that segments customers using RFM analysis and K-Means clustering to uncover actionable insights. Features include cluster distribution, revenue contribution analysis, advanced visualizations, and downloadable segmentation reports to support data-driven marketing and retention strategies.

Notifications You must be signed in to change notification settings

akbarnaeem/ecommerce-customer-segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧑‍💼 Customer Segmentation

A comprehensive project for customer segmentation using unsupervised machine learning techniques. This repository demonstrates the process of clustering customers based on their Recency, Frequency, and Monetary (RFM) features and visualizes key insights to drive business decisions.


🚀 Overview

Customer segmentation enables businesses to group their customers by purchasing behaviors, helping tailor marketing strategies and improve customer retention. This project uses clustering algorithms (K-Means) to identify distinct groups within customer data and visualizes their characteristics.


📁 Folder Structure

ecommerce-customer-segmentation/
│
├── assets/
│   ├── screenshots/
│   │   ├── dashboard.png
│   │   ├── cluster_evaluation.png
│   │   ├── cluster_insights.png
│   │   ├── cluster_feature_averages.png
│   │
│   ├── data/
│   │     ├── processed/
│   │     │      └── rfm_clusters.csv
│   │     ├── raw
│   │          └── data.csv
│   └── images/
│       ├── logo.png
│       ├── wb1.png
│       └── workflow.png
├── app.py
│
├── notebooks/
│   └── customer_segmentation.ipynb
├── requirements.txt
└── README.md

🖼️ Screenshots

Clustering Evaluation

Shows how the optimal number of clusters is determined using the Elbow and Silhouette methods.

Clustering Evaluation


Cluster Insights

Visualizes customer distribution across clusters and their revenue contribution.

Cluster Insights


Cluster Feature Averages

Highlights average RFM values for each cluster, revealing behavioral differences.

Cluster Feature Averages


Customer Dataset

Displays a sample of the segmented customer dataset, including assigned clusters and business labels.

Customer Dataset with Clusters


Cluster Heatmap

Displays a heatmap visualizing the feature distribution across clusters, helping identify patterns and similarities in customer behavior.

Cluster Heatmap


📦 Requirements

  • Python 3.9+
  • pandas, numpy, scikit-learn, matplotlib, seaborn, plotly, streamlit

Install dependencies:

pip install -r requirements.txt

📝 Usage

Clone the repo and run the main notebook or app:

git clone https://github.com/yourusername/customer-segmentation-ecommerce.git
cd customer-segmentation-ecommerce
jupyter notebook notebooks/customer_segmentation.ipynb
# or run the dashboard
streamlit run app/app.py

💡 Applications

  • Targeted marketing campaigns
  • Loyalty program design
  • Churn prediction
  • Product recommendations

🤝 Contributing

Contributions and suggestions are welcome! Please open an issue or submit a pull request.


📄 License

This project is licensed under the MIT License.


✨ Acknowledgements

Special thanks to the open-source data science community for inspiration and helpful resources.

About

An interactive dashboard that segments customers using RFM analysis and K-Means clustering to uncover actionable insights. Features include cluster distribution, revenue contribution analysis, advanced visualizations, and downloadable segmentation reports to support data-driven marketing and retention strategies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published