Giter Club home page Giter Club logo

mukulsinghal001 / customer-lifetime-prediction-using-python Goto Github PK

View Code? Open in Web Editor NEW
123.0 2.0 50.0 4.21 MB

What is CLV or LTV? CLV or LTV is a metric that helps you measure the customer's lifetime value to a business. In this kernel, I am sharing the customer lifetime value prediction using BG-NBD, Pareto, NBD & Gamma Model on top of RFM in Python.

Home Page: https://mukulsinghal001-customer-lifetime-model-de-streamlit-app-t3zaq6.streamlit.app/

Jupyter Notebook 99.93% Python 0.07% Shell 0.01% Procfile 0.01%
clv ltv data-analysis customer-lifetime-value customer-analytics customer-lifetime bg-nbd marketing-analytics machine-learning customer-segmentation ecommerce e-commerce-project e-commerce python

customer-lifetime-prediction-using-python's Introduction

Customer Lifetime Value Prediction & LTV Segmentation

Objective:

We have to predict the customer's lifetime value and segment the customers based on their LTV so that we can provide this information to the marketing team for the campaign & CPA optimization.

Introduction:

The dataset which we are going to use in this problem has taken from the UCI Machine Learning Repository. This is a transactional data set which contains all the actual transactions for a UK-based and registered ecommerce online retail store. The company mainly sells unique all-occasion gifts. This dataset has several features which includes the Invoice Number, Stock Code, Product Description, Product Quantity, Invoice Date, Unit Price, Customer ID, etc.

Before starting with the model, let's first understand what is Customer Lifetime Value.

Customer Lifetime Value Prediction

Abstract

What is Customer Lifetime Value?

Customer lifetime value (CLV) is one of the key stats likely to be tracked as part of a customer experience program. CLV is a measurement of how valuable a customer is to your company with an unlimited time span as opposed to just the first purchase. This metric helps you understand a reasonable cost per acquisition. CLV is the total worth to a business of a customer over the whole period of their relationship. It’s an important metric as it costs less to keep existing customers than it does to acquire new ones, so increasing the value of your existing customers is a great way to drive growth.

Challenges - Some companies don’t attempt to measure CLV, citing the challenges of segregated teams, inadequate systems, and untargeted marketing.

Why is it important to track customer lifetime value?

CLTV tell marketers, how much revenue they can expect from one customer over the course of the business relationship. The longer a customer continues to purchase from a company, the greater their lifetime value becomes.

To calculate the customer lifetime value, there are several methods available on the internet which you can google but here I am going to share with you the model which I have used and the reason behind choosing that specific model.

To create the model first we have to understand the course of business or in short business context and its customer's.

There are basically two types of business context which I am going to discuss below regards to the relationship and purchase opportunities.

a) Contractual - Contractual business refers to the business where there is a definite time when the customer is going to churn or we can say we know when the customer is going to be dropped. This type of customer relationship known as contractual and the customers called the subscription customers. For Ex - Hotstar, Netflix, Amazon Prime Subscription

b) Non-Contractual - In the non-contractual world, customers do go away, but they do so silently; they have no need to tell us they are leaving. This makes for a much trickier CLV calculation. For Ex- Retail/E-Commerce

Business Context

Purchase Opportunities Types:

a) Continuous - It refers the purchase opportunites when there is continuous purchases done by the customers.

b) Discrete - Under discrete, the purchase happened on a specific time period. For Ex- Subscription Plan

So based on the above, we can identify the business context and choose method which is best suited for the case.

Purpose of the research

Following the problem and motivation described above, the purpose of this study is formulated. The study aims at investigating possible methods with context to the non-contractual-continuous business for estimation of potential revenue (CLV) generated by a certain group of active customers. To perform this estimation, the probabilistic models (Pareto-NBD, BG-NBD, MBG-NBD & Gamma Gamma) has been applied to the case study in the industry. Customer segmentation by means of unsupervised machine learning was also performed in order to show an efficient tool for strategy planning.

Steps Involved in this Project: Data Importing | Data Cleaning | Exploratory Data Analysis | Feature Engineering/Extraction | Cross Validation | Different Predictive Models Building | LTV Based Customer Segmentation | Model Evaluation | Model Deployment

Libraries Used

a) Scikit Learn b) Lifetimes c) Plotly, Matplotlib, Seaborn, Altair d) XLRD e) Streamlit f) Numpy g) Pandas h) Datetime i) Math j) Pickle k) Warnings 6) Streamlit

For Model Hosting & Deployment: Heroku | Github | Streamlit

Miscellaneous:

Midway Report Link | Attributes TXT File | Dataset Link | Baseline Model Results

Final Model is Live Now: https://mukulsinghal001-customer-lifetime-model-de-streamlit-app-t3zaq6.streamlit.app/

Lead Scoring Model Project:

You can also check out my lead scoring classification prediction model related to marketing analytics as well.

customer-lifetime-prediction-using-python's People

Contributors

mukulsinghal001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.