ds@mcpanalytics.aiEmail your data and your question and get an answer about your own data, with the method shown.Email your data and question. Get an answer.

RFM segmentation

By MCP Analytics Team | Published , updated

Upload your data and get an RFM segmentation report. Free.

We email you the report link.

Free up to 10,000 rows. Encrypted in transit.

📊
-
Rows
-
Columns
-
Numeric

Running rfm segmentation analysis...

Running rfm segmentation analysis...

✓

Sent to . Inside: interactive charts, statistical results, R code, and AI insights.

Sample report

Open the full sample →

View all case studies → See all free tools →
Why an analysis, not a chat answer

Ask twice, get two answers? Watch how we fix that.

The method, in full

The practical guide behind this tool: when it applies, how to read the output, and the traps that make it say the wrong thing.

Read the guide →

A simulated example, with the code and its output

The numbers below come from made-up data, made by the code on this page. They show the method. They are not output from this tool and not a finding about your data.

Question: Which customers are the most valuable, which are slipping away, and how much of the revenue sits with the best of them?

Inputs: Simulated data, not real customers. Seed 1 makes 1,000 customers in four hidden groups, with built-in habit settings (average days since last order before a 365-day cap, orders a year, average order value): Champions (250 customers, ordered about 20 days ago on average, about 12 orders a year, high order value), Loyal (300, about 60 days, 6 orders, medium value), At risk (250, about 240 days since last order, 7 orders a year before going quiet, high value) and Small/new (200, about 90 days, 1 to 2 orders, low value). Each customer has days since last order, number of orders and total spend. The first table in the output shows the means that actually came out, which differ from the settings because of the cap and chance.

Method: RFM scoring in its usual form: Recency (days since the last order), Frequency (number of orders) and Monetary (total spend). Each of the three is ranked across all customers and cut into five equal groups (quintiles), scored 1 to 5, where 5 is best, so for recency fewer days gives a higher score. A customer then gets a segment from simple rules on those scores: Champions if recency is 4 or 5 and the average of frequency and monetary is 4 or more; Loyal if recency is 3 or more and that average is 3 or more; At risk if recency is 2 or less but the average is 3 or more; New / recent if only recency is 4 or more; Other for the rest. The segment rules here are one common choice, written for this example, not necessarily the ones the tool uses. Revenue share is a segment's total spend divided by all spend.

Result: The scores tracked the built-in groups: Champions averaged a recency score of 4.12 and a monetary score of 4.43, At risk averaged 1.98 on recency but 3.57 on monetary, and Small/new averaged 1.11 on monetary. The rules put 182 customers in Champions, who held 0.42 of revenue, and 197 in At risk, who held 0.26. The top 20% of customers by spend held 0.55 of revenue. Only 0.63 of the built-in Champions and 0.54 of the built-in At risk customers landed in the segment with their name, because the cut-offs are rough, the groups overlap, and tied order counts are split by row order.

Limit: The groups here are clean and built to differ, and the cut-offs were chosen by us. Real customers drift between groups, and the segment names and thresholds change what you see. The example does not show the tool's own segment rules, its charts, or how it handles ties and very small files.

Python script (numpy and scipy only):

import numpy as np
# Simulated orders. Built in: 1,000 customers in 4 hidden groups with different habits.
rng = np.random.default_rng(1)
# name: (customers, mean days since last order, orders per year, average order value)
spec = {"Champions": (250, 20, 12, 90), "Loyal": (300, 60, 6, 45), "At risk": (250, 240, 7, 80), "Small/new": (200, 90, 1.5, 20)}
rows = []
for gi, (name, (n, rec, freq, val)) in enumerate(spec.items()):
    for _ in range(n):
        r = min(rng.exponential(rec), 365)
        f = max(1, rng.poisson(freq))
        v = rng.gamma(4, val / 4) * f
        rows.append((gi, r, f, v))
d = np.array(rows)
g, R, F, M = d.T
def score(x, higher_better=True):
    # quintile score 1-5 by rank (ties broken by order, so five equal groups)
    rk = np.argsort(np.argsort(x, kind="stable"), kind="stable")
    s = rk * 5 // len(x) + 1
    return s if higher_better else 6 - s
r, f, m = score(R, False), score(F), score(M)
print("Seed 1, 1000 customers built from four hidden groups")
print("Scores are quintiles 1-5 (5 best); recency is scored so fewer days since last order = 5")
print("Hidden group    n   mean days  mean orders  mean spend  mean R  mean F  mean M")
for gi, name in enumerate(spec):
    k = g == gi
    print(f"{name:12s} {k.sum():5d} {R[k].mean():10.0f} {F[k].mean():12.1f} {M[k].mean():11.0f} {r[k].mean():7.2f} {f[k].mean():7.2f} {m[k].mean():7.2f}")
def seg(r, f, m):
    fm = (f + m) / 2
    if r >= 4 and fm >= 4: return "Champions"
    if r >= 3 and fm >= 3: return "Loyal"
    if r <= 2 and fm >= 3: return "At risk"
    if r >= 4: return "New / recent"
    return "Other"
S = np.array([seg(a, b, c) for a, b, c in zip(r, f, m)])
print("Rule-based segments (R, and the average of F and M):")
tot = M.sum()
for s in ["Champions", "Loyal", "At risk", "New / recent", "Other"]:
    k = S == s
    print(f"{s:13s} customers {k.sum():4d}  share of revenue {M[k].sum()/tot:.2f}")
top = np.argsort(-M)[: len(M) // 5]
print(f"Top 20% of customers by spend hold {M[top].sum()/tot:.2f} of revenue")
cm = np.array([[ (S[g==gi]==s).sum() for s in ["Champions","Loyal","At risk","New / recent","Other"]] for gi in range(4)])
print("Share of each hidden group landing in the segment named like it:")
print(" Champions group -> Champions segment: %.2f" % (cm[0,0]/cm[0].sum()))
print(" At risk group -> At risk segment: %.2f" % (cm[2,2]/cm[2].sum()))

Printed output from running the code above:

Seed 1, 1000 customers built from four hidden groups
Scores are quintiles 1-5 (5 best); recency is scored so fewer days since last order = 5
Hidden group    n   mean days  mean orders  mean spend  mean R  mean F  mean M
Champions      250         20         12.2        1106    4.12    4.46    4.43
Loyal          300         55          5.9         278    3.14    2.75    2.59
At risk        250        171          7.4         583    1.98    3.27    3.57
Small/new      200         88          1.7          34    2.67    1.21    1.11
Rule-based segments (R, and the average of F and M):
Champions     customers  182  share of revenue 0.42
Loyal         customers  188  share of revenue 0.22
At risk       customers  197  share of revenue 0.26
New / recent  customers  141  share of revenue 0.03
Other         customers  292  share of revenue 0.06
Top 20% of customers by spend hold 0.55 of revenue
Share of each hidden group landing in the segment named like it:
 Champions group -> Champions segment: 0.63
 At risk group -> At risk segment: 0.54

What's in the report?

Which customers are most valuable and which are slipping away? Recency, frequency and monetary scores, the standard segments, and where revenue sits.

📊

Statistical Results

Analysis with charts and tables.

🤖

AI Insights

Plain-English reading of the results.

Questions?

See our FAQ for pricing, privacy and how the analysis works.

How to cite this tool

By MCP Analytics Team. Last updated 5 November 2026. Cite as: MCP Analytics Team (2026). RFM segmentation. Free tool. https://mcpanalytics.ai/free/standard_rfm_v2. Accessed the date you used it.

Your data has more stories to tell

Run it on your data

Sign up to save datasets and schedule runs

Run it on your own data

Connect a source to try this method on your own numbers. Setup pages: BigCommerce, HubSpot, Klaviyo, Recharge, Shopify, Squarespace Commerce, WooCommerce.

Powered by MCP Analytics