Credit-Card Customer Segmentation
Finding customer segments, and being honest about how distinct they really are.
Public dataset. The figures here come from the committed notebook.
Problem
Problem
Marketing teams like segments: a few named groups with different strategies. The prior question is whether the data really contains distinct groups, or whether segmentation is imposing structure on a continuum.
Constraints
Constraints
- Public data
- Credit Card Dataset for Clustering: 8,950 card holders and 17 behavioural features.
- No labels
- There is no ground truth, so internal measures are all there is.
Architecture
Architecture
Public dataset8,950 card holders
Input Credit Card Dataset for Clustering: 17 behavioural features per customer.
Clean · scale8,636 rows
Deterministic step Rows with missing values dropped; features standardised.
Choose Kelbow + silhouette
Deterministic step K from 2 to 10 compared; K = 3 scored highest at 0.247.
K-MeansK = 3
Deterministic step Clusters fitted on all 17 standardised features.
ProfilesPCA for viewing only
Stored data Clusters described by mean features; PCA used only to plot them.
- Input
- Deterministic step
- Stored data
The clustering pipeline as built.
Key decisions
Key decisions
Choose K by silhouette, and read the score
K = 3 had the highest silhouette, 0.247. That's a modest score: the segments are real tendencies with overlapping edges, not clean groups.
Show reasoning
- Context
- The elbow plot was ambiguous.
- Options considered
- Pick a convenient K · choose by silhouette across K = 2–10
- Trade-off accepted
- Less tidy segments than a slide deck would like.
Revisited: a decision I changed or corrected after the evidence moved.
PCA for viewing, not for scoring
Scores in different spaces aren't comparable, so PCA is used here only to plot clusters. That earlier write-up also described a different run (K = 2); this page reports only what the committed notebook shows.
Show reasoning
- Context
- An earlier write-up compared a silhouette score in the full 17-dimensional space (0.28) with one in a 2-D PCA projection (0.37) and called it an improvement.
- Options considered
- Report the higher number · compare like with like
- Trade-off accepted
- A smaller headline number.
Implementation
Implementation
- Dropped rows with missing values (314 of 8,950) and standardised all 17 features.
- Elbow and silhouette comparison for K = 2–10, then K-Means with K = 3.
- Cluster profiles from mean features, with a 2-D PCA projection for visualisation.
Validation
Validation
- Internal only
- Silhouette and elbow; no external labels exist.
- Reconciled
- Earlier materials quoted K = 2 and K = 3. The committed notebook uses K = 3, which is what's reported here.
Results
Results
- K = 3the best silhouette of K = 2–10, at 0.247Dataset finding
- 8,636customers clustered after dropping rows with missing valuesDataset finding
- 68 / 18 / 14% split: moderate users · cash-advance heavy · high spendersDataset finding
- Dataset finding 68% moderate users: lower balances and modest purchases.
- Dataset finding 18% cash-advance heavy: average balance of about 4,000 and cash advances of about 3,900.
- Dataset finding 14% high spenders: average purchases of about 4,300.
Source: segmentation.ipynb, cell 10.
Show the data as a table
| Segment | Share |
|---|---|
| Moderate users | 67.8% |
| Cash-advance heavy | 18.1% |
| High spenders | 14% |
Limitations
Limitations
- A silhouette of 0.247 means substantial overlap between segments.
- K-Means assumes compact, similarly sized clusters, and the 68% cluster suggests that assumption is strained.
- Rows with missing values were dropped without checking whether they differ.
Lessons
Lessons
- Only compare a metric with itself under the same conditions.
- “Segments exist” is a claim that needs evidence, not a starting assumption.
What I'd do differently
- Try a density- or mixture-based method and check the segments' stability across resamples.
Where the numbers come from
- K = 3 the best silhouette of K = 2–10, at 0.247. Silhouette on all 17 standardised features; a modest score, so segments overlap. Source: credit-card-customer-segmentation/segmentation.ipynb (cells 6–7)
- 8,636 customers clustered after dropping rows with missing values. 8,950 rows in the raw file; 314 removed. Source: segmentation.ipynb (cells 2–3)
- 68 / 18 / 14 % split: moderate users · cash-advance heavy · high spenders. Cluster shares and mean-feature profiles. Source: segmentation.ipynb (cells 8, 10)