# RFM PrecisionML Recency, frequency, monetary value (RFM) is a marketing analysis model that segments a company's customer base by purchasing patterns. Specifically, it evaluates a customer's recency (how long ago they made a purchase), frequency (how often they make purchases), and monetary value (how much money they spend). Ranking by quantile is performed for each recency, frequency, and monetary value. Customers will be clustered by RFM scores into categories such as Loyalists, Champions, and Lost Customers. ## Expected Input The RFM solution analyzes a specified transaction table, input_table, whose schema varies based on the *aggregated_input* parameter. If *aggregated_input* is False, the input_table schema is expected as follows: | user | tstamp | amount | | --- | --- | --- | | 3105285968 | 2011-04-05 | 115 | | 1850985734 | 2011-11-23 | 1037 | | 274382808 | 2011-04-25 | 17 | | 358273144 | 2011-04-02 | 60 | | ... | ... | ... | For each user, * Recency is defined by days since the latest tstamp * Frequency is defined by number of transactions * Monetary is defined by total amount The max *tstamp* value in *`input_table`* is used for the reference date to define recency. When *aggregated_input* is set to *True* , the *input_table* schema is expected as follows: | **user** | **recency** | **frequency** | **monetary_value** | | --- | --- | --- | --- | | 3105285968 | 10 | 3 | 200.12 | | 1850985734 | 20 | 5 | 500.3 | | 274382808 | 30 | 1 | 50.4 | | ... | ... | ... | | If aggregated_input is False, missing value handling is done. If `aggregated_input is True`, missing value handling is not done and you would have to do the preprocessing on your own beforehand. ## Expected Outcome *Recency* , *frequency* , and *monetary_value* are each ranked by quantile. The quantile ranks for r_quartile, f_quartile, and m_quartile range from 1 to 4, with a higher value indicating better performance. The RFM score is calculated as (r_quartile + f_quartile + m_quartile) / 3. `Sample _output_table_`: | 61612 | 3181 | 4 | 4115 | 3 | 1 | 4 | R3F1M4 | 2.6667 | Promising | R3F2M2 | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | 9549 | 3227 | 8 | 1456 | 2 | 3 | 2 | R2F3M2 | 2.3333 | Need attention | R1F1M1 | | 21495 | 3326 | 6 | 2770 | 1 | 2 | 3 | R1F2M3 | 2.0 | High Value Sleeping | R3F2M2 | | 39408 | 3290 | 9 | 4893 | 2 | 4 | 4 | R2F4M4 | 3.3333 | Cannot lose them | R3F2M2 | | 8120 | 3216 | 5 | 1056 | 2 | 1 | 1 | R2F1M1 | 1.3333 | Hibernating | R1F1M1 | | 45110 | 3818 | 2 | 133 | 1 | 1 | 1 | R1F1M1 | 1.0 | Lost customers | R1F1M1 | | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | | user | recency | frequency | monetary_value | r_quartile | f_quartile | m_quartile | rfm_quartile | rfm_score | rfm_segment | rfm_cluster_rank | When cluster size is 3, the cluster `R3F3M3` represents that *recency* , *frequency* , and *monetary_value* are high and it is a promising cluster. Whereas, `R1F1M1` means that recency, frequency, and *monetary_values* are low. When *`audience_name`* is specified, *recency, frequency, monetary_values,__`r_quartile, f_quartile, m_quartile, rfm_score, rfm_segment, rfm_cluster_rank`* in *`output_table`* are attached as attribute columns of the Master Segment and Segments using *`rfm_segment`* and *`rfm_cluster_rank`* are being defined. *rfm_segment* names follow an industy-standard naming used by multiple players. See the following table for the description of 10 RFM segments. | Segment name | Description | RFM Quartile values | | --- | --- | --- | | Champions | Ideal customers. Bought recently, buys often and spends the most. | R4F4M4 | | Loyal Customers | Spends good money. Responsive to promotions. These are very active and very valuable customers. | R4F4M3, R4F3M4, R4F3M3, R3F4M4, R3F4M3, R3F3M4, R3F3M3 | | Potential Loyalists | Recent customers, spent good amount, bought more than once. | R4F4M2, R4F3M2, R4F2M4, R4F2M3, R4F2M2, R3F4M2, R3F3M2, R3F2M4, R3F2M3, R3F2M2 | | Promising | Recent shoppers bought relatively recently for high value, or frequently. So, a promising customer segment. | R4F4M1, R4F3M1, R4F2M1, R4F1M4, R4F1M3, R4F1M2, R3F4M1, R3F3M1, R3F2M1, R3F1M4, R3F1M3, R3F1M2 | | New Customers | Bought recently, but not often. | R4F1M1, R3F1M1 | | Cannot lose them | Made big purchases and often, but long time ago. Large revenue comes for this segment and better not lose their attention. | R2F4M4, R2F4M3, R2F3M4, R2F3M3, R2F2M4, R2F2M3, R2F1M4, R2F1M3 | | Need attention | Potential loyalist is losing attention. So, needs attention. | R2F4M2, R2F3M2, R2F2M2 | | Hibernating | Low spenders, low frequency, purchased long time ago. Not worth give attention to them. | R2F4M1, R2F3M1, R2F2M1, R2F1M2, R2F1M1 | | High Value Sleeping | Past potential loyalist sleeping. Worth awaking their losing interests again. | R1F4M4, R1F4M3, R1F4M2, R1F3M4, R1F3M3, R1F3M2, R1F2M4, R1F2M3, R1F2M2, R1F1M4, R1F1M3 | | Lost customers | Lowest recency, frequency, and monetary scores. This segment has the lowest priority. | R1F4M1, R1F3M1, R1F2M1, R1F1M2, R1F1M1 | ## RFM Dashboard PrecisionML generates visual dashboards that showcases the ML model's outputs, in [Treasure Insights](/products/customer-data-platform/treasure-insights). Some sample PrecisionML RFM dashboard visualizations are as follows: ![](/assets/rfm-precisionml-2025-08-15.1a634b5f225782085080d6d18ff8c79764df832b695332dd7690b8b649fa8fc4.d9983cad.png) ![](/assets/rfm3.232ab52c9bdbcf4db9a9620bbb2fc547f4d0d705e53787518deab52315822187.d9983cad.png)![](/assets/rfm4.797927c9e0a59cf095cf37bb7a54b2f0301e27135f3e4cf77f131c4bea2dd15e.d9983cad.png)