Study · 05 — Lab

Customer segmentation by behaviour

Grouping a B2B portfolio by how customers buy, not by how much they bill.

System view · demo data

Orders vs days since last purchase0102030Loyal, low spendOccasional, low valueChampionsPromising newcomersAt risk / dormantBig occasionalDays since last purchase →

Tap a segment to highlight it · tap again to see all

Customers
320
Avg. days since last purchase
72
Avg. orders
10.9

320 customers in 6 segments. Each one gets a different action: you don't write to a champion the same way as to someone who stopped buying.

The problem

Treating every customer the same wastes the commercial effort.

What I built

RFM features with log transformation and scaling, K-Means with K chosen by elbow and silhouette, validated with the Adjusted Rand Index and cross-checked against hierarchical clustering.

What changed

Actionable segments, with an interactive demo to explore them.

Tools

  • Python
  • Scikit-Learn
  • K-Means