Stages of RFM Model Implementation
This article is the second and final part of the RFM Model series. In this section i will try to explain in order what I do on the notebook in my Kaggle and github account.
As we said in the previous article
3-point Key Guide
- Recency, frequency, monetary value (RFM) a marketing analysis tool used to identify a firm’s best clients, based on the nature of their spending habits.
- An RFM analysis evaluates clients and customers by scoring them in three categories: how recently they’ve made a purchase, how often they buy, and the size of their purchases.
- RFM analysis helps firms reasonably predict which customers are more likely to make purchases again in the future, how much revenue comes from new (versus repeat clients), and how to turn occasional buyers into habitual ones.
Why you should implement an RFM Model
RFM analysis allows a comparison between potential contributors or clients. It gives organizations a sense of how much revenue comes from repeat customers (versus new customers), and which levers they can pull to try to make customers happier so they become repeat purchasers.
Despite the useful information that is acquired through RFM analysis, firms must take into consideration that even the best customers will not want to be over-solicited, and the lower-ranking customers may be cultivated with additional marketing efforts. It works as a snapshot of the clientele and as a tool to prioritize nurturing, but it should not be taken as a license to simply do more of the same-old, same-old sales techniques.
Step-by-step guide to creating your RFM model notebook
First of all, have in mind that when you try something new for your business, you need to find a logic. I recommend starting with building a database containing the history of the purchases from last a few years.
Now I will try to briefly explain the things I need to do in order.
- What is the number of unique products?
You can easily find out the number of unique products from the pandas library with the help of the .nunique () function.
2. Which product do you have?
We can observe the values of each observation with the .value_counts () function.
3. Which product is the most ordered?
You can easily get an answer to this question by selecting which variable you want to do this operation on and by using the total function with the help of Aggregation.
4. How do we rank this output?
When we sort the above Aggregate function operation, you will get the result you want.
5. How many invoices have been issued?
The answer to this question can be done in a similar way to the first question, just change the part you want which variable.
6. How much money has been earned per invoice?
If we add the variables of Quantity and Price, it can be learned how much money is earned in total per invoice and the result can be obtained from this by using aggregation per invoice.
7. Which are the most expensive products?
We can directly obtain which product is expensive or not by using the sort function.
8. How many orders came from which country?
Applying value_counts to the country variable, we get the answer.
9. Which country gained how much?
Similarly, if we apply Aggregation on the Country variable over the total price and order it, we get the answer.
10. Which product is the most returned?
Different methods can be used to find out which item has been returned. My preference was to enable the selection of these observations by using the “startswith” function since the returned ones in the data consist of letters starting with C, and then order them according to their amount.
11. What should we do for customer segmentation with RFM?
We get a groupby by the IDs specifying the customers and then aggregation the last purchase date on the invoice dates and get the last purchase date.
Everything that has been done so far was actually questions about constructing RFM variables. If we give these names to the created variables, we get the desired (R) ecency, (F) requency and (M) onetary variables.
12. Scoring for RFM.
We assign the scores of the created RFM variables according to the scores of 1,2,3,4,5 by means of the “qcut” function.
13. Finally, create an excel file named New Customer.
After scoring, we divide them into segments by making different names and save them as new customers according to the name we want (for example, according to those who are asleep). The result is clean!
Here, you can access the dataset and the work that we try to find answers to the questions from my github and Kaggle accounts.
This is all I have written about the “Business Problem with Customer Segmentation(RFM Model)”. If you want to know more about Data Science, Big Data and related others, you can check out my other serial articles. Sample:
What is the Big Data?
You can reach me from my Linkedin account for all your questions and requests.
Hope to meet you in other series articles and articles…🖖🏼
References
1. https://www.cloudkettle.com/blog/how-to-build-an-rfm-model-for-customer-segmentation/
2. https://www.kaggle.com/mathchi/business-problem-with-customer-segmentation
3. https://github.com/Mathchi/Customer-Segmentation-with-RFM-Analysis
4. https://www.omniconvert.com/blog/step-step-guide-building-rfm-model-use.html
5. https://www.investopedia.com/terms/r/rfm-recency-frequency-monetary-value.asp
6. https://twitter.com/datagyio
7. https://clevertap.com/blog/rfm-analysis/
8. https://medium.com/p/6a96b428f806/edit