Final 413439668047
Final 413439668047
Submitted By-
Name: KESAVA AULLA
Roll Number: 20
Section: A
Batch: 2020-22
1|Page
Table of Contents
ABSTRACT ................................................................................................................. 4
INTRODUCTION ......................................................................................................... 5
Measurement models of CLV ........................................................................................................... 5
RESEARCH METHODOLOGY....................................................................................... 8
OBJECTIVES ....................................................................................................................................... 8
Recency: ........................................................................................................................................... 8
Frequency: ........................................................................................................................................ 8
Revenue:........................................................................................................................................... 9
CUSTOMER SEGMENTATION.......................................................................................................... 13
CONCLUSION .......................................................................................................... 25
REFERENCES ................................................................................................................................... 26
3|Page
ABSTRACT
Customer-centric method is the new standard measure as individuals have enough options when
selecting a product/service. The need for them to grow and maintain their current customer base
is very significant. There is also a significant expense associated with the process of maintaining
current clients (by providing discounts, personalized deals, etc.),
So, do companies need to retain every single client? No. In any company, they need to maintain
their competitiveness by recognizing certain groups of customers and targeting only high-value
customers. Instead of focusing solely on increasing CTRs, marketers must shift their focus to
customer satisfaction, loyalty, and relationship building. It is better to divide customers into
homogeneous categories, recognize each group's characteristics, and target them with highly
focused promotions.
4|Page
INTRODUCTION
Customer value or Customer Lifetime Value (CLV) is calculated in numerous ways, and they have
evolved over time starting with average purchase, followed by RFM, LRFM, Clustering, Elbow
method, K-Clustering, additive regressive and K-star, etc. In CLV, Lifetime here means the amount
of time before your buyer buys with you before switching to your rivals. It might appear that
consumer profitability assessment is a simple method; it's really very complicated, though. The
requisite skills and data include: (a) datasets over specific time ranges and particular content; (b)
statistical methods to forecast and model the behavior of future consumers in terms of volume of
purchases, buying levels, and length of time spent shopping with the company and (c) analysis for
comprehending the assumptions and limitations of such models. We are trying to implement RFM
mould’s or reflects into K-Clustering
5|Page
LITERATURE REVIEW
Several articles in the customer relationship management literature have discussed customer
valuation, for example a) Customer lifetime value: Marketing models and applications by P. D.
Berger & N. I. Nasr, b) Customer lifetime valuation to support marketing decision making by F.R.
Dwyer, c) Can we predict customer lifetime value? By E.C Malthouse, R.C. Blattberg, etc. A
customer's worth has long been determined by the longevity of his historical financial value.
However, W.J. Reinartz, V. Kumar in their study named ‘On the profitability of long-life customers in
a non-contractual setting: An empirical investigation and implications for marketing’ criticize this
method, demonstrating that the profitability of a customer and a long-life cycle were not necessarily
related. A paper by S. Gupta, D.R. Lehmann, named Valuing customers in the Journal of Marketing
Research showed that the value of a company, is a function of the
Customer Lifetime Value (CLV). There is also a peer reviewed paper by Sien Chen discussing ML
models for customer lifetime value modeling. Different models for calculating CLV vary in their
predictions of potential consumer purchasing behavior. For this study, we will be using the
predictive ML approach for modeling customer lifetime value.
APPLICATION OF CLV
Customer lifetime value is a very useful metric to track for businesses as it enables them to see how
profitable or value add a customer will be in the future.
CLV is used to justify the CAC. For example, if a new customer costs $100 to acquire (COCA or
customer acquisition cost) and its lifetime value is $120, then the customer is deemed to be
profitable, and it is appropriate to acquire additional similar customers.
The applications of CLV in the business scenario are as follows-
➢ Treat customers as an asset
➢ Budgeting on the level of investment in S&M activities
➢ Sensitivity analysis to determine impact of additional spending on customer
➢ Optimal capital distribution for current marketing efforts to significantly increase return on
6|Page
investment
➢ Prioritizing long term value of consumers over investing resources in acquisition of cheaper
consumers with low lifetime value
➢ Tracking the impact of different management strategies and investments on the lifetime
value of the consumer
➢ Customer loyalty measurement in terms of proportion of purchase, purchase sequence and
frequency, probability of repurchase, etc.
7|Page
RESEARCH METHODOLOGY
OBJECTIVES
1. To identify market segments and correlate RFM with CLV
2. Identifying the right set of clusters & creating an RFM model
3. To assess customers value and train the model by feeding data to predict future values
Recency:
For calculating Recency, we have first calculated the number of days each customer is inactive for by
seeing their latest purchase date. Now, for assigning customers a recency score, K-means clustering
has been used.
Frequency:
We must first calculate the total amount of orders for each customer before we can establish
frequency clusters.
8|Page
Revenue:
The revenue for each customer is plotted on a histogram and the above clustering method is
applied again to obtain the 4 clusters
The overall score is then calculated and plotted against the CLV values of customers to predict their
future purchases
To calculate the same, we are using the Predictive Approach where we implement Machine
Learning Model to estimate the customer lifetime value, regression techniques are used to match
past data.
For this paper, we are working with the online retail dataset sourced from the University of
California Irvine ML repository. It is a data set which contains transnational data occurring between
01/12/2010 and 09/12/2011 for a UK-based online only retail store. It sells unique all-occasion gifts
to consumers as well as wholesalers.
1. Data Pre-Processing- Import the necessary libraries, load the dataset, check for datatypes and
missing values.
2. Exploratory Data Analysis- Identify important trends and patterns in the data for e.g.- Most
purchased products, trend of transactions, etc.
3. Customer Segmentation- Perform RFM (recency, frequency, monetary) analysis on the data to
identify the market segments in the customer dataset.
4. Evaluate Customer Value- Model customer lifetime value using XGBoost ML library.
5. Measure the accuracy of the model and suggest improvements.
# For this paper, Python is used after importing libraries such as Pandas, Lifetimes and XGBoost and
the commands are run in Jupiter platform.
10 | P a g
e
FINDING AND ANALYSIS
DATA PREPROCESSING
After importing the necessary libraries and loading the data, we checked for missing values. We found
that there are missing values in the description and Column ID column.
11 | P a g
e
EXPLORATORY DATA ANALYSIS
Now we are exploring different plausible ways of interpreting the data, to enable us to understand
how the customer lifetime Value that we are predicting will impact these patterns of sales,
products, etc.
12 | P a g
e
3. Transaction Trends by day of week:
CUSTOMER SEGMENTATION
RFM is a consumer segmentation strategy powered by data that enables marketers to make
educated decisions. It helps advertisers to classify and segment users into homogeneous groups
easily and target them with distinct and tailored marketing strategies. This in turn enhances the
engagement and retention of users.
13 | P a g
e
Recency:
For calculating Recency, we have first calculated the number of days each customer is inactive for by
seeing their latest purchase date. Now, for assigning customers a recency score, K-means clustering
has been used.
The distribution of recency is shown by the below histogram for our dataset:
14 | P a g
e
The clusters have been ordered so Recency cluster 3-Most recent customers and Cluster 0- Most
inactive customers.
Frequency:
We must first calculate the total amount of orders for each customer before we can establish
frequency clusters. The distribution of frequency is as follows:
15 | P a g
e
Assigning frequency clusters to the customer database:
Like the recency clusters, a higher frequency cluster indicates better customers.
Revenue:
The revenue for each customer is plotted on a histogram and the above clustering method is
applied again to obtain the 4 clusters:
16 | P a g
e
Overall Score:
An overall score for recency, frequency and revenue is created where score 8 are our best
customers and score 0 is the worst.
Low Value: 0 to 2
Mid Value: 3 to 4
High Value: 5+
Applying the above naming convention and plotting a scatter plot:
17 | P a g
e
We can clearly see the segments being differentiated from each other in the above pair wise graphs
in terms of RFM.
Now, these customer segments can be used for a variety of marketing strategies: High Value:
Improve Retention
Mid Value: Improve retention + increase frequency Low Value: Increase Frequency
Better interpretation
Different sectors
18 | P a g
e
CUSTOMER LIFETIME VALUE
MODELLING
Customer value, also known as Customer Lifetime Value (CLV), is the aggregate monetary value of a
consumer's transactions or purchases with your business for their entire lifetime. Generally, the
customer lifetime value is modelled by two broad approaches:
Historical Approach:
1. Aggregate Model: This model uses historical data to arrive at a single lifetime value based on
the average revenue per customer.
2. Cohort Model: Based on transaction date, purchase volume, etc. customers are grouped into
different cohorts and the average revenue per cohort is calculated.
Predictive Approach:
i. Machine Learning Model: To estimate the customer lifetime value, regression techniques are
used to match past data.
ii. Probabilistic Model: By applying a probability distribution to the records, this model estimates
the potential number of transactions and their monetary value for everyone.
For this paper, I’ll be using the machine learning approach for modelling customer lifetime value.
The below mentioned steps are necessary in building the model
i. Define Time frame for customer lifetime value calculation(3 months, 6
ii. months, 1 year, 2 years, etc.)
iii. Identify the feature variables
iv. Calculate LTV for training the ML model
v. Build the ML model
vi. Check the usability of the model
To decide the time frame, we must look at the industry, business model, strategies, and various
other factors. In some industries, one year can be a long enough period whereas for some it is very
19 | P a g
e
short. I have taken a period of 6 months.
For feature set, we will be using the previously calculated RFM Scores. We will split our dataset to
implement the model successfully. RFM Scores for 3 months of data will be calculated and used for
predicting the next 6 months. So, we will start with creating two data frames and then append RFM
scores.
The RFM Scoring has been created previously and the feature set is as follows:
Now, we move on to calculate 6 months LTV of every customer and use it for training our model.
Since there isn’t a cost specified, we will take the revenue as our LTV directly. The histogram of the 6
months LTV is shown below:
For building a proper machine learning model, we would have to drop the outliers and the
20 | P a g
e
customers with negative lifetime value.
Now, to observe correlation between lifetime value and our feature set, we merge 3m and 6m data
frames:
The LTV vs overall RFM score is plotted below:
We can observe that there is a positive correlation between RFM Score and LTV meaning a higher
RFM score translated to a higher LTV.
Before we can create a machine learning model, we need to find out what kind of machine learning
problem we're dealing with. LTV is a regression topic. The LTV's $ value can be predicted using a
machine learning model. But we're searching for LTV segments here. Since it makes it easier to
interact with others and make it more actionable. Utilizing K-means clustering, we will identify our
present LTV groups and create segments on top of them.
When it comes to the business side of things, we need to handle consumers differently depending
on their expected LTV. We’ll use clustering and generate 3 segments(the number of segments to be
generated depends on the business context and goals):
➢ Low LTV
➢ Mid LTV
➢ High LTV
21 | P a g
e
Now, we have applied K-means clustering to find LTV clusters and below are the characteristics of
these clusters:
Now, we can see that the LTV Cluster 2 is the best with average 8.2k LTV while LTV Cluster 0 is the
worst with LTV of 396.
Before we train the machine learning algorithm, we must complete the following steps:
➢ Some feature engineering is required. Columns that are categorical should be transformed to
numerical columns. We convert categorical columns to 0– 1 notation with the get_dummies()
method.
➢ We'll look at how features correlate with our label, LTV clusters.
22 | P a g
e
Correlation data is as follows:
We conclude that our machine learning models will benefit from 3-month Revenue, Frequency, and
RFM scores.
We'll divide our feature set and label (LTV) into two categories: X and y. To predict y, we use X. We
will make a Training and a Test dataset. The machine learning model will be developed using the
training set. To see how our model works in real life, we'll put it into practice upon this Test set..
Also, we have used the XGBoost ML Library which is an open-source library that implements
gradient boosted decision trees in a high-performance manner.
We observe that the accuracy on the test set is 84%. But is it good enough? We need to first check
our benchmark. Cluster 0, which is 76.5% of the total base is our biggest cluster. If we assume that
every customer is from cluster 0, then the accuracy of our model would be only 76.5%.
23 | P a g
e
FURTHER RESEARCH AND CHALLENGES
We can see that though our model is a useful one, but it certainly needs certain
improvements. We need to identify where our model is failing which can be identified by looking at
the below classification report:
For the Cluster 0, precision and recall are acceptable. For e.g., if the model says this customer belongs
to cluster 0 (low LTV), 90 out of 100 times it would be right (precision). In addition, the model
correctly defines 93% of real cluster 0 customers (recall). For other clusters, we really need to refine
the model. For e.g., we only detect 56 percent of customers with a Mid LTV. The following actions
can be taken for improving those points:
➢ Improve feature engineering by adding more features.
➢ Experiment with other models than XGBoost.
➢ In the current model, hyper parameter tuning can be applied.
➢ If possible, add more data to model.
Challenges
Calculating customer lifetime value (CLV) is difficult because it necessitates reliable forecasts
of future events. It's difficult to predict things like how long a customer will stay engaged with a
company and how much money they'll spend over time, particularly when the customer is new. The
fact that the data needed to perform the calculations could be buried deep inside several databases
adds to the difficulty.
24 | P a g
e
CONCLUSION
In today’s scenario, consumer behavior modelling is the most important tool a business can
have for successful marketing and selling efforts. There are various avenues for such models for e.g.,
customer segmentation, churn prediction, customer lifetime value modeling, sales forecasting,
market response modeling, etc. All these models aid businesses in precise strategy formation and
decision making.
To this study, we analyzed the UK online retail dataset to identify most valuable customer
segments through RFM analysis wherein we graded our customer database into 8 levels and built 3
segments i.e., Low Value, Mid Value and High Value. These segments can be further used for various
marketing strategies such as retargeting, discounts and targeted campaigns. Further, we modeled
customer lifetime value for a timeframe of 6 months by building a machine learning model. RFM
Score were used as features for the model and a positive correlation between RFM Scores and LTV
was observed. We further created 3 LTV clusters using K-Means Clustering with Cluster 2 having
highest 8.2k average LTV. The XGBoost ML Library was used for building the model and an accuracy
of 84% was observed on the test set. In terms of further study, we realized that we needed to refine
our model for the mid LTV segments by adding more features or having a larger dataset.
25 | P a g
e
REFERENCES
➢ Dataset Information- https://archive.ics.uci.edu/ml/datasets/online+retail
➢ Modeling customer Lifetime Value- Sunil Gupta, V. Kumar, and others
➢ https://journals.sagepub.com/doi/abs/10.1177/1094670506293810
➢ Customer lifetime value: Marketing models and applications- Nada I. Nasr
https://www.sciencedirect.com/science/article/abs/pii/S1094996898702506?via%3Dih ub
➢ On the profitability of long-life customers in a non-contractual setting-
➢ V. Kumar and Werner Reinartz
https://www.researchgate.net/publication/229819388_On_the_Profitability_of_LongLife_Customers_in_a_N
oncontractual_Setting_An_Empirical_Investigation_and_Implica tions_for_Marketing
➢ https://towardsdatascience.com/https-medium-com-vishalmorde-xgboost- algorithmlong-she-may-rein-
edd9f99be63d?gi=e82e5e9d4379
➢ https://www.datacamp.com/community/tutorials/introduction-customersegmentation- python
➢ https://medium.com/mlpoint/pandas-for-machine-learning-53846bc9a98b
➢ https://realpython.com/k-means-clustering-python/
26 | P a g
e