This notebook aims to track the movement of customers across different RFM segments for two different periods.
This notebook can be used for brands where the RFM segments have been created by running the automated RFM notebook on databricks (which makes use of K-means).
The notebook is present in the Segmentation section of the Standardized notebooks folder in the Knowledge Base repository. The name of the notebook is RFM Standardized Combined (R+F+M).
You need to provide the following details before running the Notebook.
- org_id: Enter the org_id of the brand for which RFM needs to be done.
- start_date: The start date of the duration for which RFM needs to be done has to be entered.
Format: yyyy-mm-dd. Ex: 2018-01-01.
- end_date: The end Date of the duration for which RFM needs to be done has to be entered.
Format: yyyy-mm-dd. Ex: 2020-12-31.
- This is an exploratory step that will help us in excluding the outliers from our data.
- The value entered in this field is taken as a cut off and customers having their Frequency and Monetary values higher than that will be dropped from the analysis.
- The value can be decided by looking at the output of command 22.
From this table, it can be seen that there is a huge difference between the 99th percentile of frequency and monetary values and the maximum value.
- You can enter a value between 1 and 100.
This is to exclude all the customers who have their Frequency and Monetary value much higher than the rest.
- No. of Clusters:
- This is an exploratory step that will help us in deciding the no. of individual clusters for R, F, and M values.
- The number of clusters is decided based on the output of command 31.
- This chart is an Elbow curve. Source: Wikipedia “In cluster analysis, the elbow method is a heuristic used in determining the number of clusters in a data set. The method consists of plotting the explained variation as a function of the number of clusters, and picking the elbow of the curve as the number of clusters to use.”
- The segmentation is first done individually of Recency, Frequency, and Monetary features. After this, we combine the values of the individual segment scores to come up with an overall score.
- Overall score = R+F+M (In the following example, the range of overall score will be from 0 to 6).
- This is an exploratory step, which will help us in deciding the final number of segments for our customer group.
- The visual in command 52 can help us decide the different cuts for the overall segments.
- As mentioned earlier, the overall score is equal to the sum of Recency, Frequency and Monetary scores. So, if we have 4 clusters for each of the variables with the individual score ranging from 0 to 3 then the overall score can have values between 0 and 9.
- The x-axis is the overall score after combining R, F, and M clusters. Each bar represents the % share of customers present under each overall score. Whereas, the line represents the cumulative sales contribution.
- Users have to enter the lowest possible score for each segment separated by commas. For example: 0,3,5,7 or 0,5,7 etc.
- The cuts have to be entered in the increasing order of the segment’s value. The least valuable has to be the first and the most valuable has to be the last.
- RFM Labels:
- The values have to be entered in the comma-separated format.
- The no. of values to be entered has to be equal to the no. of cuts already entered.
- If values entered are less than or greater than the no. of cuts that have been entered then the notebook will throw an error. For example, if we enter 0,3,5,7 then the values in this field will be Base, Mid, Top, Premium.
- The segment labels have to be entered in the increasing order of the segment’s value. The least valuable has to be the first and the most valuable has to be the last.
From the following output, we can observe that almost 18.8K users have downgraded from Mid segment to Base segment, whereas only ~5K have upgraded to either premium or top segment.
Open your cluster-specific link provided for the Notebook.
|Movement of Users Across RFM Segments (using Kmeans)||India, SEA, EMEA|