Use it when you want to begin customer analytics work without writing the first draft from scratch.
RFM Segmentation for E-commerce AI Prompt
Build an RFM (Recency, Frequency, Monetary) segmentation model for this e-commerce customer base. Order data: {{order_data}} (customer_id, order_date, order_value) Analysis date... Copy this prompt template, run it in your AI tool, and use related prompts to continue the workflow.
Build an RFM (Recency, Frequency, Monetary) segmentation model for this e-commerce customer base.
Order data: {{order_data}} (customer_id, order_date, order_value)
Analysis date: {{analysis_date}}
Total customers: {{customer_count}}
1. RFM metric computation:
For each customer:
- Recency (R): days since most recent purchase
- Frequency (F): total number of orders
- Monetary (M): total revenue generated
2. Quintile scoring:
- Rank all customers on each dimension from 1 (worst) to 5 (best)
- R score: 5 = purchased most recently, 1 = purchased least recently
- F score: 5 = highest order frequency
- M score: 5 = highest total spend
- Combined RFM score: concatenate the three scores (e.g. '555', '411', '123')
3. Segment definition:
- Champions (RFM 444-555): bought recently, buy often, high spend
- Loyal Customers (R3-5, F3-5, M3-5): frequent but not cutting-edge recency
- Potential Loyalists (R4-5, F1-2, M1-3): recent but low frequency - new customers showing promise
- At-Risk (R1-2, F3-5, M3-5): used to be great customers but haven't bought recently
- Can't Lose Them (R1, F4-5, M4-5): previously highest-value, now gone
- Hibernating (R1-2, F1-2, M1-2): low on all dimensions
- Lost (R1, F1, M1): low on all, no recent activity
4. Segment sizing and value:
- Count and % of customers in each segment
- Total revenue and % of revenue per segment
- Average AOV and purchase frequency per segment
5. Marketing actions per segment:
- Champions: VIP treatment, loyalty program invitation, referral ask
- At-Risk: re-engagement campaign, exclusive offer, personal outreach for high-value
- Can't Lose Them: win-back campaign with strong offer, survey why they left
- Hibernating: last-chance reactivation email before sunset
- Potential Loyalists: second-purchase nurture, loyalty points accelerator
6. Segment migration tracking:
- Run the RFM model monthly
- Track how many customers move between segments
- Net migration to Champions: leading indicator of business health
Return: RFM scoring methodology, segment definitions and sizes, revenue contribution table, marketing actions per segment, and migration tracking plan.When to use this prompt
Use it when you want a more consistent structure for AI output across projects or datasets.
Use it when you want prompt-driven work to turn into a reusable notebook or repeatable workflow later.
Use it when you want a clear next step into adjacent prompts in Customer Analytics or the wider Ecommerce Analyst library.
What the AI should return
The AI should return a structured result that covers the main requested outputs, such as RFM metric computation:, Recency (R): days since most recent purchase, Frequency (F): total number of orders. The final answer should stay clear, actionable, and easy to review inside a customer analytics workflow for ecommerce analyst work.
How to use this prompt
Open your data context
Load your dataset, notebook, or working environment so the AI can operate on the actual project context.
Copy the prompt text
Use the copy button above and paste the prompt into the AI assistant or prompt input area.
Review the output critically
Check whether the result matches your data, assumptions, and desired format before moving on.
Chain into the next prompt
Once you have the first result, continue deeper with related prompts in Customer Analytics.
Frequently asked questions
What does the RFM Segmentation for E-commerce prompt do?+
It gives you a structured customer analytics starting point for ecommerce analyst work and helps you move faster without starting from a blank page.
Who is this prompt for?+
It is designed for ecommerce analyst workflows and marked as intermediate, so it works well as a guided starting point for that level of experience.
What type of prompt is this?+
RFM Segmentation for E-commerce is a single prompt. You can copy it as-is, adapt it, or use it as one step inside a larger workflow.
Can I use this outside MLJAR Studio?+
Yes. The prompt text works in other AI tools too, but MLJAR Studio is the best fit when you want local execution, visible Python code, and reusable notebooks.
What should I open next?+
Natural next steps from here are Customer Acquisition Cost Analysis, Customer Lifetime Value Analysis, Repeat Purchase and Retention Analysis.