RFM Segmentation
Three numbers that rank your entire customer base
RFM scores each customer on Recency, Frequency, and Monetary value, then groups them into segments such as champions, at-risk, and hibernating. It is the fastest way to convert a transaction table into actionable customer groups.
What you will learn
- Compute RFM scores from a transaction fact table
- Turn raw recency, frequency, and monetary values into quintile buckets
- Map score combinations to named, actionable segments
What is this?
RFM segmentation scores every customer on three dimensions: Recency (how recently they bought), Frequency (how often they buy), and Monetary value (how much they spend). Each dimension is bucketed (for example 1–5), and the three digits form a postal code of value that maps onto classic segments such as Champions (5-5-5), Loyal (high F and M), At-Risk (long recency), and Lost.
Why do you need it?
- It is the fastest defensible segmentation for a transaction table — no model fitting required.
- Segments map directly to retention and win-back actions.
- It makes revenue skew visible: a small set of high-value customers dominates.
Mental model
Scoring customers 1-to-5 on three tests at once
A credit score
A single composite number compresses a lot of behavior into something decision-makers can sort by in seconds.
How it works
- Compute recency as days since the most recent purchase, frequency as number of purchases, monetary as total spend.
- Rank each dimension into quintiles and score 1–5 (5 = best).
- Concatenate scores as R-F-M and map to names like Champions, Potential Loyalists, Need Attention, At Risk, Hibernating.
- Define an action for each segment and monitor segment migration between periods.
RFM bands a customer base from champions to lost accounts with one composite score.
In production
- Email campaigns are built per RFM segment instead of blasting the whole base.
- Finance segments the P&L by RFM buckets to see where value concentrates.
- Loyalty programs tune rewards to frequency and monetary tiers.
Best practices
- Recompute RFM on a fixed cadence (monthly is common) and keep bucket boundaries stable so segments are comparable over time.
- Document the quintile thresholds so a 4 today means the same thing next quarter.
Common mistakes
- Using raw quantiles that change every run, making segments incomparable.
- Mixing acquisition dates across product lines with different purchase cycles.
Debugging tips
- If Champions suddenly shrink, check whether quintile boundaries shifted rather than customer behavior.
- If new customers dominate a high-frequency bucket, filter to customers past their first cycle.
Interview checkpoint
Hands-on lab
- Compute recency, frequency, and monetary value per customer
- Bucket each dimension into quintiles
- Map RFM combinations to named segments and summarize
RFM Segmentation with pandas
40 min · intermediate
Quick quiz
RFM stands for
A customer scored 5-5-5 is best described as a