Customer Analytics
Intermediate 15 min read Customer Analytics

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.

RFMrecencyfrequencymonetarysegmentationcustomer value
Before we start

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
Introduction

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.

Motivation

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.
Think about it

Mental model

Imagine

Scoring customers 1-to-5 on three tests at once

Think of

A credit score

A single composite number compresses a lot of behavior into something decision-makers can sort by in seconds.

Mechanics

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.

Aggregate
Bucket
Map
Target
Real world

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.
Guidelines

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.
Watch out

Common mistakes

  • Using raw quantiles that change every run, making segments incomparable.
  • Mixing acquisition dates across product lines with different purchase cycles.
When things break

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.
Interviews

Interview checkpoint

Practice

Hands-on lab

RFM Segmentation with pandas
40 min · intermediate
In progress
Objectives
  • 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

0/4 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself

Quick quiz

0/2
1

RFM stands for

2

A customer scored 5-5-5 is best described as a

Go deeper

Official documentation