Identify your valuable customers

How do you carry out your marketing activities towards your current customers?

Nafiz ALTAY
CodeX
5 min readSep 22, 2021

--

In this article, I will talk about the RFM that can be customized to many different sectors. We will look at the Python segmentation with those who are interested.

What is RFM? Is that edible?

We call RFM comes from the words Recency, Frequency, Monutery. If you say what these words mean, you can examine the image below.

Based on the assigned RFM behavior scores, customers can be grouped into segments and their profitability can be further analyzed.

The combined score of the three values is the most beneficial for brands in the eCommerce platform as it requires constant monitoring of customer behavior. The insights from the RFM calculation can provide brands with a clearer understanding of frequent shopping paths and understand the customer reaction to new marketing campaigns.

RFM model has been widely applied in many practical areas, including nonprofits and financial organizations (banking and insurance industries), online industries, telecommunication industries, travel industries, and marketing industries. In addition, the RFM model can be used to segment customers, calculate customer value and customer lifetime value (CLV), observe customer behavior, estimate the response probability for each offer type and evaluate online reviewers.

RFM Segment Descriptions

The resulting matrix looks like this:

RFM Segment Matrix

The advantage of RFM are that it is easy to implement and can be used for different types of business. It helps craft better marketing campaigns and improves CRM and customer loyalty.

It is estimated that customers with a high RFM score will return to the brand for more purchases. With special attention to such ‘loyal’, ‘champion’ customers, the brand can optimize its advertising activities through feedback.

A customer with a low RFM score indicates a reluctance to become a loyal customer. While their responses to advertising campaigns might be insignificant, marketers should turn focus to their recency parameter and figure out what frustrated or did not appeal to such customers. Through RFM scores, brands know exactly which parameter to focus on for every customer.

Let’s start some coding!

I will use the Online Retail dataset available on the UCI Machine Learning Repository.

We need to understand our data with some descriptive statistics.

Remove the missing observations from the data set. Use the ‘inplace=True’ parameter for subtraction.

How many of each product are there?

We continue to calculate the RFM metrics. We need to define today_date as an analysis date for calculating recency.

Calculation of RFM Scores and turning into one variable

Now it’s time to define!

The RFM scores give us 53 = 125 segments. Which is not easy to work with. We are going to work with 10 segments based on the R and F scores. We have set up regular expression(regex) structure by using dictionaries to name customer segments according to their Recency and Frequency Scores.

We visualize our output data with Tableau.

Congrats! You’re all set!

In general, the frequency values are quite low. At this point, it may be advisable to organize promotions and high discount campaigns. We need to give our priority to our customers who are present but whose loyalty may decrease day by day.

It is seen that customers with the cant_loose segment have a high-frequency value in the general average, but they have recently withdrawn from the system themselves. This segment has high earning potential if the right strategies are applied for the company. A significant discount is recommended for quick recovery. A recovery campaign that appeals to emotion can be created.

The at_Risk segment includes our customers who are familiar with the system and have a significant shopping experience. It should be in the first place in the segments that need to be focused on, its recovery will provide high returns to the company. Here, promotional campaigns can be organized for the product groups they have shopped for the target audience. There may be a mass that withdraws itself from the system by purchasing a stocked product. Product-based campaigns can be recommended for them.

Let me know if I missed any steps, if something didn’t work out quite right for you, or if this guide was helpful! Thank you for reading!

Github: https://github.com/nfzaltay/customer-segmentation-rfm

References:

  • Data Science School (Veri Bilimi Okulu)
  • Jo-Ting Wei, Shih-Yen Lin and Hsin-Hung Wu, 2010, A review of the application of RFM model, African Journal of Business Management, Vol. 4(19), pp. 4199–4206

--

--