What RFM is
RFM scores every guest on three axes: how recently they visited (R), how often they visit (F), and how much they spend per visit (M). Each axis gets a 1-5 score, so every guest ends up with a 3-digit code like 5-5-4 (top tier) or 1-1-1 (lost).
It's not machine learning. It's arithmetic. And in most restaurant databases it explains 70%+ of future revenue.
How to compute it
Sort all guests by last_visit_date, chunk into 5 equal buckets, the top 20% gets R=5, next 20% R=4, and so on. Repeat for visit_count (F) and total_spend (M). Three passes through the table.
In Habitu this runs nightly and powers the segment selector in Campaigns.
What to do with each segment
5-5-5 (champions): don't discount them. Invite them to a tasting, a new product preview, a table hold. Recognition beats rewards.
5-1-x (new, high-spend): win them fast. Send the second-visit offer within 7 days.
1-5-5 (was loyal, slipping): this is where the money is. A well-timed notification recovers 30-40% of these guests in the first 60 days.