RFM Series

All Customers Are Equal, But Some Are More Equal Than Others: RFM, Step by Step

What you’ll get

  • A framework to ring-fence your best customers: find the few who bring most of the revenue, and protect them before a competitor gets to them.
  • A principled way to segment customers: replace gut feel and one-size-fits-all campaigns with clear segments, each with its own focused tactic.
  • An early warning for business drift: spot loyal customers going quiet months before it shows up in the revenue numbers, and act while there’s still time.
  • Smarter use of the marketing budget: know where to invest, where to automate and where to stop spending.
  • A health check you can run every month: track whether your customer base is getting stronger or weaker, and hold teams to it.

Three footprints

Every customer leaves three footprints: when they last came, how often they come, and how much they spend.

The revenue report adds them all up and treats every customer the same. But the detailing-devil gets lost in the aggregation – highest spender from last year may already be gone and the newbie from last week may need a little nudge to make his first purchase.

All customers are equal, but some are more equal than others. RFM analysis tells you which ones, and how to go about it.

What RFM is, and what it isn’t

RFM asks three plain questions about every customer:

  • Recency (R): how long since they last bought?
  • Frequency (F): how many times have they bought?
  • Monetary (M): how much have they spent?

The idea comes from direct marketing in the days of printed catalogues and mail lists. In the 1990s, Arthur Hughes popularised it as a way to decide which customers were worth the cost of a mailed catalogue.

The original RFM was built for end customers. However, with minor tweaks, it works for dealers and distributors too, and that is the scope of Part 2 of this series.

Read: What Sells With What, Market Basket Analysis
Read: What Sells With What, Market Basket Analysis

What RFM isn’t: an explanation. Like MBA, RFM shows correlation, not causation: it tells you how customers have behaved, not why. A customer gone quiet may have moved city, switched to a competitor or simply not needed anything. RFM tells you where to look; the insight, finding out why, stays with the marketer.

The running example: five customers

Five real customers from the dataset we’ll analyse later travel with us through the whole post. The snapshot date is 10 December 2011.

Five customers: days since last purchase, orders and net spend

Look at the first two. Customers 12417 and 17504 placed the same number of orders and spent about the same. On a revenue report they look like twins. Only one number separates them: 12417 bought four days ago, and 17504 hasn’t been back for seven months.

That single number is the difference between a customer to reward and a customer you may be losing. Keep an eye on 17504; we’ll come back to them.

Under the hood: computing R, F and M

Each customer gets three numbers, one row per customer.

Recency is the number of days between the customer’s last purchase and a fixed “today”, called the snapshot date. We set the snapshot to the day after the last date in the data: the data ends on 9 December 2011, so the snapshot is 10 December 2011. That extra day means a customer who bought on the last day scores 1, not 0. Every customer is measured against the same date, and nobody buys after the data ends, so Recency is never 0 or negative.

Frequency is the number of separate orders (invoices), not the number of order lines. A customer who buys ten items in one order has bought once.

Monetary is net spend: what they bought, minus what they returned.

For our five customers, that gives the table you’ve already seen: 12417 last bought 4 days before the snapshot, 17504 207 days before.

How cancellations and returns are treated in RFM

Indexing values on a scale of 1–5

Raw numbers are hard to compare: days, order counts and monetary values have different scales.

RFM transforms each one of them into a score from 1 to 5, where 5 is best.

Recency and Frequency use fixed business cut-offs.

Recency and Frequency cut-offs for scores 1 to 5

A common approach is to split each measure into five equal groups (quintiles) instead. That breaks on Frequency: most customers buy once or twice, so the edge points land on the same number and the code fails.

The fixed business cut-offs are a better approach in my opinion – it allows for managing cut-off contextually for the marketer since recency and frequency are also contextual to the industry.

Monetary uses natural bands. Spend is heavily skewed: a few customers spend far more than the rest.

We take 2 steps:

  1. Take the log of net spend to scale the data
  2. and find five natural groups using KMeans clustering. The group with highest centroid value gets a score of 5 and so on. On our data, the bands fall at about £27, £258, £731 and £2,211.

With this approach: Our five customers now read as three-digit codes (R, F, M):

Five customers as RFM codes
Keep M bands fixed between runs

How does one treat 125 customer groups!

Five scores on three measures give 5 × 5 × 5 = 125 possible codes, from 555 down to 111. Each code is a cell: a group of customers who behave alike.

Approach 1: 125 cells, segmented and actioned accordingly

Group the cells into named segments

It is impractical to run 125 different campaigns. So the cells are grouped into named segments. The segment names and the actions may vary for different industries – the list below is a mere illustration.

Named RFM segments with rules and actions

M does two jobs here. It separates “Can’t lose them” from “At risk”, and inside any segment, the higher-M customers come first.

Our five customers land like this: 12417 is a Champion, 17504 is Can’t lose them, 12847 is a New customer, 15808 is At risk and 13227 is Lost. The twins from the revenue report now get opposite treatment: a thank-you for one, a phone call for the other.

Approach 2: one composite score

Sometimes you want a single number per customer: to sort a list, set a cut-off or brief a team. There are three common ways to combine R, F and M into one score. All three use the same five tiers, so they can be compared directly.

Method 1: the simple sum

Add the three scores: R + F + M, from 3 to 15. It’s easy to explain, but very different customers can tie. A big spender who has gone quiet (155) and a new customer with one small order (551) both score 11.

Method 2: business-set weights

Give each parameter a weight that fits how your industry buys.

Score=wR×R+wF×F+wM×M,wR+wF+wM=1\text{Score} = w_R \times R + w_F \times F + w_M \times M, \quad w_R + w_F + w_M = 1

The weights add up to 1, so the score stays on the same 1–5 scale.

In FMCG, Recency and Frequency matter most and Monetary less, because ticket sizes are moderate. In premium bathrooms or cars, Recency and Monetary matter most: everyone buys rarely, and these are deliberate, planned purchases.

RFM weights by industry

These are starting points, not rules.

What a high Recency means in long-cycle categories

For our gift-ware dataset we use R 0.40, F 0.35, M 0.25.

Method 3: AHP (Analytic Hierarchy Process)

“What weight should Recency get?” is a hard question. AHP, developed by Thomas Saaty in the 1970s, asks easier ones: which matters more, and by how much? It compares two factors at a time on a 1–9 scale (1 = equally important, 3 = moderately more, 5 = strongly more, 7 = very strongly more, 9 = extremely more).

Take a premium bathroom brand. A business head might say:

  • R vs F: Recency matters moderately-to-strongly more, because everyone buys rarely. 4.
  • R vs M: Recency matters a little more. 2.
  • M vs F: Monetary matters moderately more. 3.

Those three answers fill a comparison matrix. Each cell says how much more important the row is than the column; the mirror cell is the reciprocal.

AHP comparison matrix

Turning the matrix into weights takes three steps. Let’s walk one column through them first.

Step 1: add up each column. Take the R column. It holds 1 (R vs R), 1/4 (F vs R) and 1/2 (M vs R). Its total is 1 + 0.25 + 0.5 = 1.75. The F column adds up to 4 + 1 + 3 = 8, and the M column to 2 + 1/3 + 1 = 3.33.

Step 2: divide each cell by its column total. For the R column:

  • R: 1 ÷ 1.75 = 0.571
  • F: 0.25 ÷ 1.75 = 0.143
  • M: 0.5 ÷ 1.75 = 0.286

The three now add up to 1. What this column says: measured against Recency, R deserves about 57% of the weight, F 14% and M 29%. Each column gives the same kind of answer from a different starting point, F’s view and M’s view:

AHP matrix normalised by column

Step 3: average each row. The three columns roughly agree but not exactly, so we average them:

  • R: (0.571 + 0.500 + 0.600) ÷ 3 = 0.56
  • F: (0.143 + 0.125 + 0.100) ÷ 3 = 0.12
  • M: (0.286 + 0.375 + 0.300) ÷ 3 = 0.32

The weights come out at R 0.56, F 0.12, M 0.32, and they add up to 1.

The pay-off: the simple sum rates a recent big buyer with one order (514, sum 10) and a frequent small buyer gone quiet (252, sum 9) almost equally. With the AHP weights, the first scores 4.20 and the second 2.36, which is the ranking a premium bathroom business would want.

AHP strength and limit

For our dataset we use R vs F = 1, R vs M = 3 and F vs M = 2, which give R 0.44, F 0.39, M 0.17.

From scores to tiers and actions

Composite score tiers and actions

Our five customers:

Five customers’ composite scores and tiers

Putting it together: a score says how much, a segment says why

Go back to customer 17504. They placed nine orders and spent £2,745, then went quiet seven months ago. Approach 1 calls them Can’t lose them and asks for a phone call.

Composite scores put the customer in High or Medium, and doesn’t trigger a personal win-back.

Recommendation: A composite tells you how much a customer is worth overall, not why. So use both: the score to sort and size, the segment to decide the action.

How often to run it

There’s no single standard. A good rule of thumb is to run RFM about as often as half the typical gap between a customer’s purchases, so a missed cycle shows up within one run. Run it more often and the scores barely move between runs; run it less often and you only notice customers after they’ve already gone.

How often to run RFM by industry

Three points go with the cadence:

  1. Some triggers shouldn’t wait for the next run. For high-value customers, set an alert when their Recency crosses a threshold, for example a Top-tier customer going 60 days without an order. Scheduled runs are for reviewing the whole base; alerts catch the important exceptions.
  2. Each run should compare against the last one. The value is in movement, such as how many Top customers dropped to Medium this month. Keep the M band edges fixed between runs so the movement is real.
  3. Recency cut-offs should scale with the industry, not just the run frequency. The 30/60/90/180-day bands suit gift-ware. For cars or premium bathrooms, a 180-day gap is normal, so those bands would mark nearly every customer as lapsed. Long-cycle industries need bands measured in months or years.
Use a rolling 12-month window

What RFM won’t do for you

  • It only looks backward. RFM describes what customers did, not what they will do next.
  • It shows behaviour, not reasons. A quiet customer may have switched brands, moved city or simply not needed anything.
  • It ignores margin. A high-M customer who buys only on discount may be worth less than a mid-M customer paying full price.
  • Its Recency bands must fit the industry. The same cut-offs can’t serve groceries and cars.

The payoff: it arms the expert

RFM decides who gets attention; the business decides what that attention looks like. It turns a customer list into a short list of people to call, a group to automate and a group to stop chasing. The judgment on the offer, the timing and the tone stays with the people who know the customers.

Action plan: from code to conclusions

The data is the UCI Online Retail II dataset: transactions from a UK online gift-ware seller, December 2009 to December 2011. I merged the two yearly files and published the result on Kaggle. The code runs in Google Colab with pandas and scikit-learn.

The full notebook, with every step annotated, is on GitHub: Click here for notebook.

What the data showed

Pareto

Pareto curve: top 20% bring 65% of revenue

The top 20% of customers bring 65% of net revenue. That’s the marked point. The well-known “80/20 rule” (named after the economist Vilfredo Pareto) is a rule of thumb, not a law. Here the split is closer to 20/65, still a heavy tilt towards a few customers.

Where the customers sit

Recency × Frequency heatmap

The top-right box is almost all yellow. Customers who bought in the last 30 days and placed six or more orders are also the biggest spenders. These are the Champions: the three footprints line up. The bottom-left box is the densest cloud on the chart, mostly purple and blue. It’s full of customers who bought once, more than six months ago, and spent little. They’re the largest group, and the least valuable.

Customer counts by Recency and Frequency band

Top right: 534 customers bought in the last 30 days and placed six or more orders. That’s 15% of the base, and they’re your Champions. Bottom left: 489 customers bought once, more than six months ago. That’s 14% of the base, and most of them are lost. One order is the most common story. The left column holds 1,234 customers, a third of the base, who have bought only once. It’s the biggest group in every row except the top one. Getting a second order is the first job of any retention plan.

Customer share vs revenue share by segment

What it shows

  • Champions carry the business. They are 29% of customers and bring 70% of net revenue, more than all the other segments combined. Losing a handful of them hurts more than losing hundreds of the rest.
  • Only two segments earn more than their headcount share. Champions (29% → 70%) and Loyal (3% → 4%) are the only ones where the blue bar beats the grey. Both buy often, so frequency is what turns a customer into revenue. The biggest crowd brings the least. Lost and Hibernating together are 26% of customers but only 7% of revenue. Spending heavily to win them back rarely pays.
  • Potential loyalists are the growth pool. They are 17% of customers but only 9% of revenue. They’ve bought recently, two or three times. Moving even some of them into Champions would add more revenue than any win-back campaign.
  • “Can’t lose them” looks small, but the bars mislead. They are 2% of customers and 2% of revenue: about 70 people with the spending habits of a Champion, now gone quiet. That 2% is revenue walking out of the door, and a phone call costs little.

The takeaway

Protect the 29% who bring 70%. Grow the 17% next in line. Call the 2% who are slipping. Automate the rest, and stop spending on the 26% who have already gone.

Now run it on your own customers

  1. Pick the window: a rolling 12 months for most retail, longer for long-cycle categories.
  2. Clean the data: customer IDs, non-product rows, cancellations netted off spend.
  3. Set your Recency and Frequency cut-offs to fit how your customers buy.
  4. Score, segment and profile. Then check R before you act on any tier.
  5. Re-run on a schedule with fixed M bands, and watch who moves.

The annotated notebook is on GitHub: here is the detailed notebook. I’d love to hear which segment surprised you most in your own data.

Coming up

Part 2: RFM for dealers and distributors. Part 2 covers what to add on top of RFM, and how to decide which dealers to invest in, protect, grow or serve efficiently.

Later in the series: customer lifetime value, which adds what RFM can’t, a forward-looking estimate of what each customer is worth.

Credit

Title inspired by George Orwell, Animal Farm (1945): “All animals are equal, but some animals are more equal than others.”

References

  • Hughes, A. M. Strategic Database Marketing. McGraw-Hill (first edition 1994). Record
  • Saaty, T. L. The Analytic Hierarchy Process. McGraw-Hill, 1980.
  • Liu, D.-R. and Shih, Y.-Y. “Integrating AHP and data mining for product recommendation based on customer lifetime value.” Information & Management 42(3), 2005.
  • Chen, D. Online Retail II [dataset]. UCI Machine Learning Repository, 2012. CC BY 4.0. https://doi.org/10.24432/C5CG6D
  • Merged 2009–2011 file: Kaggle, krjynt/online-retail-ii-2009-2011-merged

Comments

Leave a Reply

Discover more from AI | ML | DL

Subscribe now to keep reading and get access to the full archive.

Continue reading