Customer segmentation that leads to different actions
In this article (3 sections)
A segmentation is useful when groups support different decisions, measurement plans or service designs. Naming clusters “gold,” “loyal” and “at risk” after seeing centroids creates a story; it does not show that different actions work.
Profile every assigned customer
Our standardized K-means case assigns all 360 synthetic customers to three 120-row clusters. Their current profiles are:
| Cluster ID | Visits | Average order | Return rate | Hypothetical test |
|---|---|---|---|---|
| 0 | 6.03 | 119.62 | 0.0339 | Premium-service test |
| 1 | 16.09 | 47.67 | 0.2434 | Returns-guidance test |
| 2 | 11.69 | 31.24 | 0.0568 | Routine-replenishment test |
Cluster IDs are arbitrary. A refit can rename them even when the profiles are identical. Operational code should map profiles or aligned stable identifiers, not assume that “cluster 0” always means premium.
from unsupervised_cases import segmentation_case
r = segmentation_case()
assert r['assigned_customers'] == 360
assert sorted(row['customers'] for row in r['profiles']) == [120, 120, 120]
assert {row['hypothetical_action'] for row in r['profiles']} == {
'premium_service_test', 'returns_guidance_test', 'routine_replenishment_test'
}
print(r)Run the profiles in the unsupervised lab. The actions are hypotheses. No treatment was run and no outcome lift is claimed.
Move from profile to experiment
For each segment, state the proposed action, mechanism, primary outcome, guardrail, eligibility and cost. A high return rate might reflect product fit, logistics or policy abuse; guidance could help, do nothing or create friction. Cluster membership does not identify the cause.
Check segment size, stability, assignment latency and feature availability. Define a fallback for missing data and a policy for customers near boundaries. Monitor how many customers migrate and whether profiles retain their meaning.
Test actions with a valid experiment or causal design where possible. Compare segment-specific treatment effects with a simpler policy; sometimes one universal rule performs as well and is easier to operate. Protect small or sensitive groups from exploratory actions that have not received appropriate review.
Version the scaler, centroids, profile mapping and action table. Store the model version and assignment date with each decision. A segment name should describe observable behaviour without implying personal traits or intent.
Exercise: write a randomized test plan for one hypothetical action, including control, outcome maturity, sample size assumptions and stop conditions. Then define how a new cluster version can coexist with in-flight experiments without relabelling history.
NeuraPath's Data Science course connects segmentation to testable decisions. The cluster is a routing hypothesis; the outcome study determines whether the route helps.
Continue learning
This article is part of the Clustering, reduction and recommendations sequence. Use the neighbouring tasks when you need the prerequisite or the next application.
- Review the prerequisite or neighbouring task in t-SNE and UMAP: why a picture does not prove clusters.
- Continue with Association rules: compare lift, confidence and support.
Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.
This article is part of our Data Science programme — 6 months. From data foundations to machine learning, deep learning and deployment.
Explore Data Science