Score customers on Recency, Frequency, and Monetary value; map to segments, and prioritize actions that lift revenue and retention
Automatic quantile binning (2-10 bins configurable) with reverse scoring for recency. Creates 9 predefined segments: Champions, Loyal Customers, Potential Loyalists, New Customers, At Risk, Lost, Hibernating, Big Spenders, Low Value.
Complete segment statistics: customer count, revenue contribution percentages, mean/median RFM values. Sorted by total revenue contribution for prioritization.
RFM score distributions, segment matrix heatmaps showing customer density, and customer-level scoring for targeted campaigns. Top/bottom customer identification.
Provide transaction data with customer_column, date_column, and amount_column. Supports multiple date formats including YYYY-MM-DD, MM/DD/YYYY, DD/MM/YYYY.
Algorithm aggregates by customer to calculate: days since last purchase (recency), transaction count (frequency), total spend (monetary). Then applies quantile binning and maps to 9 predefined segments based on score combinations.
From raw transactions to actionable segments
Parse dates flexibly, aggregate by customer to calculate last purchase date, transaction count, and total spend. Handle analysis_date parameter or default to latest transaction.
Apply quantile binning to create scores: Recency (reverse scored - lower is better), Frequency and Monetary (higher is better). Map score combinations to 9 segments using predefined rules.
Calculate segment profiles with customer counts, revenue percentages, mean/median RFM values. Generate distribution visualizations and segment matrix heatmaps.
RFM quantile scoring automatically identifies 9 customer segments based on purchase behavior, enabling targeted retention and growth strategies.
Champions (high R/F/M scores ≥4) drive revenue. At Risk customers (high F/M but low R) need re-engagement. New Customers (high R only) require nurturing. Segment profiles show revenue contribution and customer distribution for prioritization.
Note: Segments use fixed rules: Champions (R≥4, F≥4, M≥4), Loyal (R≥3, F≥3, M≥3), etc. For custom segmentation logic or predictive CLV, consider BG/NBD models.
Build actionable RFM segments and playbooks
Read the article: RFM Segmentation