Data Mining Applications
Churn / Affinity
Data Mining for DA 3130
slides from multiple online sources 1
Data Mining Applications :
Learning Outcome
How we can use Data Mining on Real World
Applications
2
Churn Prediction
“Churn rate (sometimes called attrition rate), in its broadest sense, is
a measure of the number of individuals or items moving out of a
collective group over a specific period of time”
3
Two Types of Churn
Subscription models:
• Examples: Telco, Subscription based News
Sites
• -> you know when someone leaves
Non subscription models:
• Examples: E-Business (Amazon, Darraz,
AlliExress)
• -> you approximate someone leaving
Number of days not using the service etc
Blurred Separation:
• Ex: Telco Pre-Paid Vs Post Paid
[Link]
4
Dealing with churn
Motivations :
Saturated market
-> cost get new client >>> cost keep client
Example :
Wireline company : 2% to 2.5 % churn rate per
month.
■ With 5M customers -> 1.32M walk out with $ 2B
revenue per year
■ Reducing churn from 2.5% to 2% with a lowest
estimation : $ 240M in 18 months
Source:[Link]
[Link]
5
How to Deal with Churn
Predict churn :
One model for performance <- focus, short term,
classification
One model for understanding <- long term, clustering,
association
Act on it (short term) :
• Special offer (telco: call free, discount coupon )
• Does it work? Feedback loop needed!
• Model probabilities of leaving because of offer. A/B
tests. Multi arms Bandit?
Act on it (long term) :
• Is there a problem in the purchasing funnel?
•[Link]
Is the price too high etc ? 6
Source: [Link]
7
Customer Churn Example
What are we trying to predict?
■This is the Label:
■Did the customer churn? True or False
What are the “if questions” or
properties we can use to predict?
■These are the Features:
■Number of Customer service calls, Total
day minutes….
[Link]
8
Telecom Customer Churn Data
• State: string • Total eve calls: integer
• Account length: integer • Total eve charge: double
• Area code: integer • Total night minutes: double
• International plan: string • Total night calls: integer
• Voice mail plan: string • Total night charge: double
• Number vmail messages: • Total intl minutes: double
integer • Total intl calls: integer
• Total day minutes: double • Total intl charge: double
• Total day calls: integer • Customer service calls:
• Total day charge: double integer
• Total eve minutes: double
9
Decision Trees
■Decision Tree for Classification
■Represents tree with nodes
■IF THEN ELSE questions using
features at each node.
[Link] 10
Decision Trees - Example
[Link]
11
Data Mining Pipeline
[Link]
12
Feature Extraction / Model
Selection
13
K-fold Cross-Validation
Data is randomly split into K partition training and test
dataset pairs
[Link]
14
K-fold Cross-Validation
Train algorithm with training dataset
[Link]
15
K-fold Cross-Validation
Evaluate the model with the Test Set
[Link]
16
K-fold Cross-Validation
Repeat K times
select the Model produced by the best-performing set of
parameters
17
Comparing the Results: ROC
■ Accuracy is measured
by the area under the
ROC curve.
■ The area measures
correct classifications
■ An area of 1
represents a
perfect test
■ an area of .5
represents a
worthless test
[Link] 18
Affinity Mining
Affinity analysis is a data analysis and data mining
technique that discovers co-occurrence relationships
among activities performed by (or recorded about) specific
individuals or groups.
19
Affinity Mining
• In general, this can be applied to any process where agents
can be uniquely identified and information about their
activities can be recorded.
• In retail, affinity analysis used to perform market basket
analysis:
• retailers seek to understand the purchase behavior of
customers.
• This information can then be used for purposes of
• cross-selling and up-selling,
• influencing sales promotions,
• loyalty programs,
• store design,
• discount plans, etc
20
Market Basket Analysis
■Allows us to identify patterns in customer
purchases.
■Answer questions like
■What products tend to be bought
together?
■What products may benefit from
promotion?
■What are the best cross‐selling
opportunities?
■The often‐quoted example of beer and
nappies (an urban legend, in fact).
[Link]
21
Transaction Data
Ti Items bought
d
10 Beer, Nuts, Diaper
20 Beer, Coffee, Diaper
30 Beer, Diaper, Eggs
40 Nuts, Eggs, Milk
50 Nuts, Coffee, Diaper, Eggs,
Milk
■A store sells a large set of products .
■A transaction (basket) is a set of products
bought by a customer at a particular time.
■The set of transactions is often encoded as
a
■sparse binary matrix (can be very large)
22
Basic Concepts: Association Rules
Ti Items bought
d ■ Find all the rules X Y with
10 Beer, Nuts, Diaper
20 Beer, Coffee, Diaper
minimum support and
30 Beer, Diaper, Eggs confidence
40 Nuts, Eggs, Milk ■ support, s, probability that
50 Nuts, Coffee, Diaper, Eggs,
Milk a transaction contains X Y
Customer
buys both
Customer ■ confidence, c, conditional
buys
diaper probability that a
transaction having X also
contains Y
Customer Let minsup = 50%, minconf = 50%
[Link]
Pat.: Beer:3, rules:
Nuts:3, (many
buys beer
Diaper:4,
more!){Beer, Diaper}:3
Eggs:3,
Beer Diaper (60%,
[Link] 100%)
The Apriori Algorithm—An Example
Supmin = 2 Itemset sup
Itemset sup
Database TDB {A} 2
L1 {A} 2
Tid Items C1 {B} 3
{B} 3
10 A, C, D {C} 3
{C} 3
20 B, C, E 1st scan {D} 1
{E} 3
30 A, B, C, E {E} 3
40 B, E
C2 Itemset sup C2 Itemset
{A, B} 1
L2 Itemset sup
{A, C} 2 2nd scan {A, B}
{A, C} 2 {A, C}
{A, E} 1
{B, C} 2 {A, E}
{B, C} 2
{B, E} 3
{B, E} 3 {B, C}
{C, E} 2
{C, E} 2 {B, E}
{C, E}
C3 Itemset
3rd scan L3 Itemset sup
{B, C, E} {B, C, E} 2
[Link]
24
Visualizing Rules
25
Visualizing Rules
[Link] 26
Visualizing Rules
[Link] 27
Visualizing Rules : Movies example
[Link]
28
Data Mining Success Factors
1. Clear business goals the company aims to
achieve using Data mining
2. Relevancy of the data sources to avoid duplicates
and unimportant results
3. Completeness of the data to ensure all the
essential information is covered
4. Applicability of the Data Mining results to meet
the goals specified
5. Customer engagement and bottom line growth as
the indicators of data mining success
Source: [Link]
29
Data Mining
Not Magic But
Focused Hard Work
30