Back to Projects
Customer Segmentation
Case Study2023

Customer Segmentation

Project Introduction

This data science project applies unsupervised learning to segment customers based on purchasing behavior, helping businesses identify high-value groups and tailor marketing strategies.

The pipeline covers data cleaning, feature engineering, model selection, and visualization—translating raw transactional data into actionable cluster profiles stakeholders can understand.

Tech Stack

PythonScikit-learnPandasMatplotlibJupyter

Key Learnings

  • Feature Engineering for Clustering

    Transformed raw purchase logs into RFM-style features—recency, frequency, and monetary value—that significantly improved cluster separation and interpretability over using raw transaction counts alone. Additional derived features such as average basket size and product category diversity helped distinguish high-value loyal customers from one-time buyers. Missing values and outliers were handled with domain-appropriate imputation rather than blanket removal, preserving records that represented genuine edge-case behavior. The engineered feature set gave each cluster a clear business narrative that stakeholders could act on immediately.

  • Model Evaluation

    Compared K-Means and hierarchical clustering approaches using silhouette scores, elbow plots, and business-readable cluster summaries to select the most interpretable model. K-Means proved faster on the full dataset but hierarchical clustering revealed nested sub-segments useful for targeted campaign design. Each cluster was profiled with mean feature values and representative customer examples so marketing teams could understand who belonged where without reading code. The evaluation process prioritized interpretability alongside statistical fit, ensuring the model output was usable in real campaign planning.

  • Stakeholder Storytelling

    Built visual dashboards and written cluster profiles that explain segment characteristics without requiring ML literacy from business readers. Bar charts, heatmaps, and annotated scatter plots highlighted the defining traits of each customer group—spending frequency, preferred categories, and geographic concentration. A one-page summary per cluster translated model output into recommended marketing actions such as retention offers or upsell campaigns. This storytelling layer bridged the gap between the data science pipeline and the business decisions that ultimately depended on its output.