Champions
Loyalty rewardsR 4–5 and F 4–5
- Who they are
- Bought recently, buy often and spend the most.
- What to do
- VIP rewards: early access to new ranges, volume pricing and a named account contact.
The segment map
The brief
We work for a UK online gift retailer that sells mainly to wholesalers. The Marketing Manager has one budget for loyalty rewards and win-back emails, and needs to know who deserves which.
The Marketing Manager of a UK online gift retailer whose buyers are mostly wholesalers and repeat business customers.
How to split a single budget between loyalty rewards for the best customers and win-back emails for the ones drifting away.
Every pound lands on the segment with the most revenue at stake: more repeat orders from the best customers and more lapsed customers buying again.
The data
About 1 million invoice lines from December 2009 to December 2011, published in the UCI Machine Learning Repository. Each line is one product on one invoice.
Columns
Business questions
Each section of the explorer answers one of them, in the same order as the notebook.
Revenue resampled by month to find the peak season, with a 3-month rolling average to show the trend.
resampleRevenue ranked by country and by product, with the share each one contributes.
groupbyRecency, Frequency and Monetary value for every customer, scored from 1 to 5 by our own function and mapped to six segments.
def rfm_segment()Customers ranked by spend to see how concentrated revenue is.
cumsumCustomers grouped by the month of their first purchase, and the share who buy again 1, 2 and 3 months later, shown as a heatmap.
pivot_tableSee it on the real data
Method
One step beyond descriptive statistics: rule-based RFM segments, checked against K-means clustering.
Seven logged steps remove guest rows, cancellations, zero or negative quantities and prices, postage and fee codes, unreadable dates and exact duplicates.
Recency is days since the last order, Frequency the number of invoices and Monetary the total spend. Each is split into five equal groups and scored 1 to 5.
Our function maps the Recency and Frequency scores to six segments, from Champions to Lost.
K-means runs on log-transformed, standardised R, F and M values. The elbow method picks the number of clusters.
A cross-tab of clusters against segments shows where the rules and the algorithm agree, and where they do not.
Each recommendation is tied to a number from the analysis and an estimated revenue impact.
R = 5 means the most recent buyers, F = 5 the most frequent ones.
| Segment | Rule | Budget |
|---|---|---|
| Champions | R 4–5 and F 4–5 | Loyalty rewards |
| Loyal | R 3–5 and F 3–5, not Champions | Loyalty rewards |
| Promising | R 4–5 and F 1–2 | Nurture |
| Need attention | R 3 and F 1–2 | Nurture |
| At risk | R 1–2 and F 3–5 | Win-back emails |
| Lost | R 1–2 and F 1–2 | Minimal spend |
Segment playbook
What each segment means for the Marketing Manager's budget.
R 4–5 and F 4–5
R 3–5 and F 3–5, not Champions
R 4–5 and F 1–2
R 3 and F 1–2
R 1–2 and F 3–5
R 1–2 and F 1–2
Customer Segment Explorer
Upload the Online Retail II file as CSV. The explorer cleans it, scores every customer, runs K-means and draws the charts. Filter by segment, country and date range, then download the result.
The file never leaves your browser.
Up to a million rows, read in chunks.
Seven cleaning steps, RFM scores, segments and clusters.
Linked charts, a cohort heatmap and a CSV download.