An unsupervised machine learning project that segments 200 mall customers into distinct groups using K-Means clustering. Working from age, annual income, and spending score data, the notebook identifies 5 natural customer personas that could inform targeted marketing or retail strategy.
How can a mall or retailer make sense of its customer base without any pre-defined labels? The challenge is grouping customers into meaningful segments purely from behavioral and demographic signals — no target variable, no supervision.
The dataset (sourced from Kaggle) contains 200 customers with four features: gender, age, annual income (k$), and spending score (1–100). The pipeline was:
k-means++ initialization (10 random starts, max 300 iterations) on all three numeric features. Each customer was assigned a cluster label.Five distinct customer segments emerged, broadly interpretable as personas along the income/spending axes — for example, high-income high-spenders (prime targets), low-income high-spenders (potentially over-extended), high-income low-spenders (disengaged affluent), and so on. The 3D visualization confirmed clean cluster separation, particularly between the extreme corners of the income–spending space.
The elbow method is a simple but effective way to avoid the trap of over-clustering — it provides a principled stopping point rather than an arbitrary choice. Visualizing clusters in 3D rather than multiple 2D projections made the segmentation far more intuitive; the spatial groupings that looked ambiguous in 2D scatter plots were clearly separated when all three dimensions were shown at once. Unsupervised results are only as useful as their interpretability, and investing in the right visualization is as important as the model itself.