ecom-rfm-analysis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRFM Analysis
RFM分析
Overview
概述
RFM segments customers based on three behavioral dimensions: Recency (when they last bought), Frequency (how often they buy), and Monetary (how much they spend). It converts raw transaction data into actionable customer segments for targeted marketing.
RFM基于三个行为维度对客户进行细分:Recency(最近一次购买时间)、Frequency(购买频率)和Monetary(消费金额)。它将原始交易数据转化为可落地的客户分群,用于精准营销。
Framework
框架
IRON LAW: RFM Uses ACTUAL Behavior, Not Demographics
RFM is behavioral segmentation — it classifies by what customers DO,
not who they ARE. A 25-year-old and a 65-year-old in the same RFM segment
should receive the same treatment. Never mix RFM with demographic
assumptions.IRON LAW: RFM Uses ACTUAL Behavior, Not Demographics
RFM is behavioral segmentation — it classifies by what customers DO,
not who they ARE. A 25-year-old and a 65-year-old in the same RFM segment
should receive the same treatment. Never mix RFM with demographic
assumptions.The Three Dimensions
三个维度
| Dimension | What It Measures | How to Calculate |
|---|---|---|
| Recency (R) | Days since last purchase | Today - Last purchase date |
| Frequency (F) | Number of purchases in period | Count of distinct transactions |
| Monetary (M) | Total spend in period | Sum of transaction values |
| 维度 | 衡量内容 | 计算方式 |
|---|---|---|
| Recency (R) | 距离上次购买的天数 | 当前日期 - 上次购买日期 |
| Frequency (F) | 统计周期内的购买次数 | 独立交易的数量 |
| Monetary (M) | 统计周期内的总消费额 | 交易金额总和 |
Scoring Method (Quintile-Based)
评分方法(基于五分位数)
- For each dimension, rank all customers and divide into 5 equal groups (quintiles)
- Score 5 (best) to 1 (worst): R=5 means most recent, F=5 means most frequent, M=5 means highest spend
- Combine into 3-digit RFM score (e.g., R5-F4-M5 = recent, frequent, high-value)
Note: For Recency, LOWER days = HIGHER score (more recent is better).
- 针对每个维度,对所有客户进行排名并划分为5个均等分组(五分位数)
- 评分从5(最佳)到1(最差):R=5表示最近购买,F=5表示购买频率最高,M=5表示消费金额最高
- 组合为3位RFM评分(例如:R5-F4-M5 = 近期购买、高频、高价值)
注意:对于Recency维度,天数越少,评分越高(越近期越好)。
Key Segments
核心客户群
| Segment | RFM Pattern | Description | Strategy |
|---|---|---|---|
| Champions | R5, F5, M5 | Best customers, recent, frequent, high-value | Reward, loyalty program, early access |
| Loyal | R4-5, F4-5, M3-5 | Consistent buyers | Upsell, cross-sell, referral program |
| Potential Loyalists | R4-5, F2-3, M2-3 | Recent, moderate frequency | Nurture to increase frequency |
| At Risk | R2-3, F3-5, M3-5 | Were frequent/high-value, not buying recently | Win-back campaign, special offers |
| Hibernating | R1-2, F1-2, M1-2 | Long dormant, low value | Low-cost reactivation or let go |
| New Customers | R5, F1, M1-2 | Just made first purchase | Onboarding, second-purchase incentive |
| 客户群 | RFM模式 | 描述 | 策略 |
|---|---|---|---|
| 冠军客户 | R5, F5, M5 | 最佳客户,近期购买、高频、高价值 | 奖励机制、忠诚度计划、优先体验 |
| 忠诚客户 | R4-5, F4-5, M3-5 | 持续购买的客户 | 向上销售、交叉销售、推荐计划 |
| 潜在忠诚客户 | R4-5, F2-3, M2-3 | 近期购买、购买频率中等 | 培育以提升购买频率 |
| 流失风险客户 | R2-3, F3-5, M3-5 | 曾是高频/高价值客户,近期未购买 | 赢回活动、专属优惠 |
| 沉睡客户 | R1-2, F1-2, M1-2 | 长期未活跃、低价值 | 低成本激活或放弃 |
| 新客户 | R5, F1, M1-2 | 刚完成首次购买 | 新用户引导、二次购买激励 |
Implementation Steps
实施步骤
Phase 1: Data Preparation
- Required: Customer ID, Transaction Date, Transaction Amount
- Clean: Remove refunds, test orders, internal orders
- Set analysis window (typically 12-24 months)
Phase 2: Calculate RFM Scores
- Calculate R, F, M for each customer
- Assign quintile scores (1-5) for each dimension
- Combine into segments
Phase 3: Segment and Act
- Map each customer to a named segment (Champions, At Risk, etc.)
- Design targeted actions per segment
- Measure results: did targeted customers behave differently?
阶段1:数据准备
- 所需数据:客户ID、交易日期、交易金额
- 数据清洗:移除退款、测试订单、内部订单
- 设置分析周期(通常为12-24个月)
阶段2:计算RFM评分
- 为每位客户计算R、F、M值
- 为每个维度分配五分位数评分(1-5)
- 组合为客户群
阶段3:分群并行动
- 将每位客户映射到对应的命名客户群(冠军客户、流失风险客户等)
- 针对每个客户群设计精准行动方案
- 衡量结果:精准触达的客户行为是否发生变化?
Output Format
输出格式
markdown
undefinedmarkdown
undefinedRFM Analysis: {Business}
RFM Analysis: {Business}
Data Summary
Data Summary
- Customers analyzed: {N}
- Analysis window: {start} to {end}
- Transactions: {N}
- Customers analyzed: {N}
- Analysis window: {start} to {end}
- Transactions: {N}
Segment Distribution
Segment Distribution
| Segment | Count | % | Avg R (days) | Avg F | Avg M |
|---|---|---|---|---|---|
| Champions | {N} | {%} | {days} | {count} | ${X} |
| At Risk | {N} | {%} | ... | ... | ... |
| ... | ... | ... | ... | ... | ... |
| Segment | Count | % | Avg R (days) | Avg F | Avg M |
|---|---|---|---|---|---|
| Champions | {N} | {%} | {days} | {count} | ${X} |
| At Risk | {N} | {%} | ... | ... | ... |
| ... | ... | ... | ... | ... | ... |
Key Findings
Key Findings
- Top 20% customers contribute {X%} of revenue
- {N} customers at risk of churning (were high-value, now dormant)
- {N} new customers need second-purchase nurturing
- Top 20% customers contribute {X%} of revenue
- {N} customers at risk of churning (were high-value, now dormant)
- {N} new customers need second-purchase nurturing
Recommended Actions
Recommended Actions
| Segment | Action | Channel | Expected Impact |
|---|---|---|---|
| Champions | {loyalty reward} | {email/app} | Increase AOV by X% |
| At Risk | {win-back offer} | {email/SMS} | Recover X% of dormant revenue |
undefined| Segment | Action | Channel | Expected Impact |
|---|---|---|---|
| Champions | {loyalty reward} | {email/app} | Increase AOV by X% |
| At Risk | {win-back offer} | {email/SMS} | Recover X% of dormant revenue |
undefinedGotchas
注意事项
- RFM is backward-looking: It tells you what customers DID, not what they WILL do. Combine with predictive models (CLV prediction) for forward-looking insights.
- Equal quintiles may not make sense: If 80% of customers bought only once, quintile 1-4 are all "one-time buyers." Consider custom breakpoints based on business context.
- Monetary can be misleading for subscriptions: If everyone pays the same subscription fee, M dimension adds no information. Drop it and use RF only.
- B2B vs B2C frequency differs: A B2B customer buying quarterly is "frequent." A B2C customer buying quarterly may be "at risk." Calibrate to business context.
- Don't over-message At Risk customers: Bombarding dormant customers with emails can increase unsubscribes. One well-crafted win-back campaign is better than weekly emails.
- RFM是回顾性分析:它告诉你客户过去的行为,而非未来的行为。结合预测模型(CLV预测)可获得前瞻性洞察。
- 均等五分位数可能不适用:如果80%的客户仅购买过一次,那么五分位数1-4均为“一次性买家”。需结合业务场景设置自定义断点。
- 消费金额维度对订阅业务可能无意义:如果所有用户支付相同的订阅费用,M维度无法提供有效信息。可移除该维度,仅使用RF分析。
- B2B与B2C的购买频率差异:B2B客户每季度购买属于“高频”,而B2C客户每季度购买可能属于“有流失风险”。需根据业务场景调整标准。
- 不要过度触达流失风险客户:向沉睡客户发送大量邮件可能增加退订率。一次精心设计的赢回活动效果优于每周发送邮件。
Scripts
脚本
| Script | Description | Usage |
|---|---|---|
| Score customers on R/F/M and assign segment labels | |
Run to execute built-in sanity tests.
python scripts/rfm_score.py --verify| 脚本 | 描述 | 使用方式 |
|---|---|---|
| 为客户计算R/F/M评分并分配客户群标签 | |
运行 可执行内置的合理性测试。
python scripts/rfm_score.py --verifyReferences
参考资料
- For Python/SQL implementation code, see
references/rfm-implementation.md - For CLV prediction extending RFM, see
references/clv-prediction.md
- Python/SQL实现代码,请查看
references/rfm-implementation.md - 基于RFM扩展的CLV预测,请查看
references/clv-prediction.md