Plan your investments with CLTV Prediction

Investments are company’s commitment for better future. Each company has it’s own calculations to determine the amount of investment, direction and time of exposure. Also a lot work should be done to determine which way to promote/advert our next steps. But as economics is here to say, for sharing limited resources to limitless demands; every company also has limited resources to reach certain part of their customers.

But further of reaching them, we need to understand whether they will continue to buy from us. For example who will be our company’s top 10 most valuable customer 2 quarters later; or which ones aren’t buying anymore from our company so we can specify our adverts for them.

Let’s start.
We have one year dataset of a retail gift shop. This analysis will start as if dataset has no null and no minus values. So we have kind of a “half-baked” dataset.
Retail gift shop dataset’s variables are as below:

Invoice — Unique code for bill/invoice
StockCode — Unique code for product
Description — Product name
Quantity — Number of product sold in certain bill
InvoiceDate — Bill date and time
UnitPrice — Price of product
Customer ID — Unique customer ID for each customer
Country — Name of the country where sale occurs

Above, for each customer we have created:
1. Number of days between customer’s first buy and last buy
2. Customer life — days between today and customer’s first buy
3. Gathering unique invoices/bills
4. Sum of total paid invoices per customer

Thereafter we need to change the name of columns.
Now please find below the last settings before creating BG/NBD and Gamma Gamma model.

Basically in the first row monetary variable has been updated as monetary variable divided by frequency; second row updates frequency variable data’s higher than 1; third row divides recency variable by 7 (to get the data for one week) and the same done for T variable.

BG/NBD Model help up predict the amount of sales for each customer in certain period of time. For our dataset, the BG/NBD model as been written as below. More to follow, the second part give the first results for one month purchasing amount for each customer.

After BG/NBD model, with Gamma Gamma model we can find out how much each customer will probably spent for a certain of time.
Gamma Gamma model described as below and actually measures possible purchase amount per invoice per customer.

So now we have all the parameters, models and we are ready to calculate how much (take care that there is no unit for BG/NDB + GG when used together) our customers are ready to trade in our company within next 6 months.
Please find out below codes and the result for head(10).

Yes we got the result for Customer Lifetime Value. But as you can see these information without any unit isn’t enough to explain how much actually our first 10 customers are ranked when we consider the whole data of our customers within dataset. So in that case scaling and thereafter segmenting the customers would give us the necessary data on how to address our resources for certain part of our customers.

With this we were finally able to categorize our customers by their purchasing behavior (based on amount of purchased products and amount of payment for this products).
We have predicted how many bills our customers will print within 6 month, thereafter predicted the average profit per customer per week. And lately we calculated a number that can be used to rank our customers based on the profit they’ll be able to pay us within 6 month. This number has been scaled from bottom D to top A.
Now the bottom part of our customers are categorized as D. These are our customers that probably will pay the least amount for our company. They need to be treated completely from top A customers, which actually pay us the largest part.

Necessary steps should be taken toward making our D or C customers more loyal to our products. This will lead in increase of our company’s profits, decrease company’s risk exposure to unstable customers and also will help us design a more stable investment plan for future.

Collecting purchasing behavior data’s of our customers help us find the amount of investments we will be able to do in near future. With the example above we were able to calculate expected purchase for each our customers for a certain period of time.
Let’s assume that we’ve got amount of money for each of our customers will be able to pay within 12 month. This will help us calculate the amount of new fiscal year’s budget, sale increase amount, advertisement amount and most important the amount we can use to invest for future projects.

This project has been done with the support of:
VBO, Oğuz Erdoğan, handey




Economics, Data Analysis

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Develop ML Models from Scratch for Healthcare provider fraud detection analysis

As per US Govt. Mandate Healthcare Fraud & Abuse are the crime, it is punishable with civil penalties, imprisonment, and provider exclusion from Federal healthcare programs.

Why Do We Split Datasets?

Does Weather Affect a Pitcher’s Ability to Strikeout a Batter?

Data Science Interview Prep

A new model for search results ranking in graph data

Demystifying Merge Sort

Exploratory data analysis on 2018 Kaggle Machine learning and Data Science survey

Visual Thinking Family Tree

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Blirind Danjolli

Blirind Danjolli

Economics, Data Analysis

More from Medium

Big Data ? Finding what Matters and predicting a recession !

Big Problems with Big Data

The 5 Magic Power-Tools that will Massively Reduce Stress and Boost your Self-Belief

The Democratization of the Stock Market