SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Beyond Churn Prediction :
An Introduction to Uplift Modelling
Pierre Gutierrez
Plan
•  Introduction / Client situation
•  Uplift Use Cases
•  Global Uplift Strategy
•  Machine learning for Uplift
•  Uplift Evaluation
•  Conclusion
Material
•  Complete project
http://gallery.dataiku.com/projects/DKU_UPLIFT/
•  Notebooks & Data
https://github.com/PGuti/Uplift.git
Dataiku
•  Founded in 2013
•  60 + employees
•  Paris, New-York, London, San Francisco
DESIGN
Load and prepare
your data
PREPARE
Build your
models
MODEL
Visualize and share
your work
ANALYSE
Re-execute your
workflow at ease
AUTOMATE
Follow your production
environment
MONITOR
Get predictions
in real time
SCORE
PRODUCTION
Data Science Software Editor of Dataiku DSS
Motivations
Client situation
•  Client : French Online Gaming Company (MMORPG)
•  Users are leaving (more than 10 years old )
•  let’s do a churn prediction model !
•  Target : no come back in 14 or 28 days.
(14 missing days -> 80 % of chance not to come back
28 missing days -> 90 % of chance not to come back)
•  Features :
•  Connection features :
•  Time played in 1,7,15,30,… days
•  Time since last connection
•  Connection frequency
•  Days of week / hours of days played
•  Equivalent for payments and subscriptions
•  Age, sex, country
•  Number of account, is a bot …
•  No in game features (no data)
	
  
	
  
Client situation
•  Model Results :
•  AUC 0.88
•  Very stable model in time
•  Marketing actions :
•  7 different actions based on customer segmentation
(offers, promotion, … )
•  A/B test
-> -5 % churn for persons contacted by email
•  Going further :
•  Feature engineering : guilds, close network, in game actions, …
•  Study long term churn …
Uplift Definition
•  But wait !
•  Strong hypothesis : target the person that are the most likely to churn
Uplift Definition
•  But wait !
•  Strong hypothesis : target the person that are the most likely to churn
•  What is the gain / person for an action ?
•  cost of action
•  fixed value of the customer
•  independent variables
•  “treated” population and “control” population
• 
•  Value with action :
•  Value without action :
•  Gain :
c
vi i
X
T C
Y =
⇢
1 if customer churn
0 otherwise
ET
(Vi) = vi(1 PT
(Y = 1|X)) c
EC
(Vi) = vi(1 PC
(Y = 1|X))
E(Gi) = vi(PC
(Y = 1|X) PT
(Y = 1|X)) c
vi(hypothesis	
  :	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  independent	
  of	
  ac1on)	
  	
  
Uplift Definition
•  But wait !
•  Strong hypothesis : target the person that are the most likely to churn
•  What is the gain / person for an action ?
•  Real Target :
People who are †he most likely to change positively their behavior if there is an action
Upli5	
  =	
  Model	
  
E(Gi) = vi(PC
(Y = 1|X) PT
(Y = 1|X)) c
P
Uplift Definition
•  Gain to maximize:
•  Targeting churner:
Does not optimize the difference !
Is good if treatment good.
•  Intuitive examples:
•  : action is expected to make the situation worst. Spam ?
•  : user does not care
E(Gi) = vi(PC
(Y = 1|X) PT
(Y = 1|X)) c
PC
(Y = 1) ⇡ PT
(Y = 1)
PC
(Y = 1) < PT
(Y = 1)
Uplift Definition
If not treated
Positive Response Negative Response
Unnecessary costs Negative impact
Positive Response
Negative Response
If treated
Unnecessary costs
The people we want
to target
SURE THINGS SLEEPING DOGS
PERSUADABLES LOST CAUSES
Uplift Use Cases
Uplift Use Cases
•  Healthcare :
•  Typical medical trial:
•  Treatment group: gets the treatment
•  Control group: gets placebo (or another treatment)
•  Statistical test show that the treatment works or not globally
•  With uplift modeling we can find out for whom the treatment works best
•  Personalized medicine
•  Ex : What is the gain in survival probability ?
-> classification/uplift problem
Uplift Use Cases
•  Churn :
•  E-gaming
•  Other Ex : Coyote
•  Retail :
•  Compare effect of
coupons campaigns
•  Marketing / CRM :
•  Churn
•  E-Mailing
Example
•  Mailing : Hillstrom challenge
•  2 campaigns :
•  one men email
•  one woman email
•  Question : who are the people to target / that have the best response rate
Uplift VS Causal Inference methods
•  Causal inference closer to econometrics
•  Uplift closer to ML, more practical
•  Evaluation based on Cross Validation
•  Usage of classical ML models
•  Sometimes lack of theory
•  Different people who don’t really talk together:
•  Different Notations (sorry). Today is uplift’s
•  Different evaluation functions
•  Different models ?
Not really !
Global Uplift Strategy
Uplift as a natural evolution
Train	
  Data	
  
Step 1 : train a (churn) model
Training	
  
Churn	
  Model	
  
Uplift as a natural evolution
Train	
  Data	
  
Test	
  Data	
  
A/B	
  test	
  on	
  
scored	
  dataset	
  
Step 2 : A/B test the model
Training	
  
Churn	
  Model	
  
Uplift as a natural evolution
Train	
  Data	
  
Test	
  Data	
  
A/B	
  test	
  on	
  
scored	
  dataset	
  
Step 3 : train your uplift model
Training	
  
Churn	
  Model	
  
Training	
  
Uplift as a natural evolution
Train	
  Data	
  
Test	
  Data	
  
A/B	
  test	
  on	
  
scored	
  dataset	
  
New	
  scoring	
  
Step 4 : deploy
Training	
  
Churn	
  Model	
  
New	
  Test	
  Data	
  
Upli5	
  Model	
  
Training	
  
Uplift as a natural evolution
Train	
  Data	
  
Test	
  Data	
  
A/B	
  test	
  on	
  
scored	
  dataset	
  
New	
  scoring	
  
Capitalize on your A/B test data !
Training	
  
Churn	
  Model	
  
New	
  Test	
  Data	
  
Upli5	
  Model	
  
Training	
  
Today’s Focus
Machine learning Model
Uplift modeling
•  Three main methods in Uplift Literature:
•  Two models approach
•  Class variable modification
•  Modification of existing machine learning models
(tree based methods, out of the scope of today).
•  Generalization: Causal inference approach
•  Main Assumption (Uncofoundedness) :
Control and Treatment belonging should be independent of the response
Uplift modeling : Two model approach
•  Build a model on treatment to get
•  Build a model on control to get
•  Set :
PT
(Y |X)
PC
(Y |X)
P = PT
(Y |X) PC
(Y |X)
Uplift modeling : Two model approach
•  Advantages :
•  Standard ML models can be used
•  In theory, two good estimators -> a good uplift model
•  Works well in practice
•  Generalize to regression and multi-treatment easily
•  Drawbacks
•  Difference of estimators is probably not the best estimator of the difference
•  The two classifier can ignore the weaker uplift signal (since it’s not their target)
•  Algorithm focusing on estimating the difference should perform better
Uplift modeling : Class variable transformation
•  Introduced in Jaskowski, Jaroszewicz 2012
•  Allows any classifier to be updated to uplift modeling
•  Let denote the group membership (Treatment or Control)
•  Let’s define the new target variable :
•  This corresponds to flipping the target in the control dataset.
G 2 {T, C}
Z =
8
<
:
1 if G = T and Y = 1
1 if G = C and Y = 0
0 otherwise
•  Why does it work ?
•  By design (A/B test warning !), should be independent from
•  Possibly with a reweighting of the datasets we should have :
thus
P(Z = 1|X) = PT
(Y = 1|X)P(G = T|X) + PC
(Y = 0|X)P(G = C|X)
P(Z = 1|X) = PT
(Y = 1|X)P(G = T) + PC
(Y = 0|X)P(G = C)
G X
P(G = T) = P(G = C) = 1/2
2P(Z = 1|X) = PT
(Y = 1|X) + PC
(Y = 0|X)
Uplift modeling : Class variable transformation
•  Why does it work ?
Thus
And sorting by is the same as sorting by
2P(Z = 1|X) = PT
(Y = 1|X) + PC
(Y = 0|X)
= PT
(Y = 1|X) + 1 PC
(Y = 1|X)
P = 2P(Z = 1|X) 1
P(Z = 1|X) P
Uplift modeling : Class variable transformation
•  Summary :
•  Flip class for control dataset
•  Concatenate test and control dataset
•  Build a classifier
•  Target users with highest probability
•  Advantages :
•  Any classifier can be used
•  Directly predict uplift (and not each class separately)
•  Single model on a larger dataset (instead of two small ones)
•  Drawbacks :
•  Complex decision surface -> model can perform poorly
Uplift modeling : Class variable transformation
Generalization :
•  From Athey:
Y ?
= Y G e(X)
e(X)(1 e(X))Let
•  Any classical estimator can be used
•  Generalize to more advanced A/B test schemed
•  Specific estimator can be derived (see paper)
With
E(Y ?
= P)Then (Unconfoundedness)
e(X) = P(G = 1|X)
Uplift modeling : Other methods
•  Based on decision trees :
•  Rzepakowski Jaroszewicz 2012
new decision tree split criterion based on information theory
•  Soltys Rzepakowski Jaroszewicz 2013
Ensemble methods for uplift modeling
(out of today scope )
Model Evaluation
Evaluation
•  Problem :
•  We don’t have a clear 0/1 target.
•  We would need to know for each customer
•  Response to treatment
•  Response to control
-> not possible
•  Cross Validation :
•  Train and Validation split
•  Stratified on target/control variable.
Evaluation: Uplift Decile / Bins
•  Uplift bins:
•  Sort dataset by predicted uplift descending
•  Calculate uplift per bin
•  Hard to compare models
YT number of positive in treated
YC number of positive in control
NT number in treated
NC number in control
U = YT
NT
YC
NC
Evaluation: Uplift Decile / Bins
•  Cumulative Uplift bins :
•  Sort dataset by predicted uplift descending
•  Calculate uplift on all bins preceding
•  Cumulative Uplift Gain bins :
•  Sort dataset by predicted uplift descending
•  Calculate uplift on all bins preceding
•  Multiply by number of instances
Evaluation: Uplift Curve
•  Generalization of the previous curve
Parametric curve defined by:
•  Similar to lift / ROC Curve
•  Models can be compared ! AUC
Evaluation: Qini
•  Introduced in Radcliffe
Parametric curve defined by: f(t) = YT (t) YC(t) ⇤ NT (t)/NC(t)
t (observa1ons)	
  
Evaluation: Qini
•  Best model :
•  Take first all positive in target and last all positive in control.
•  No theoretic best model :
•  depends on possibility of negative effect
•  Displayed for no negative effect
•  Random model :
•  Corresponds to global effect of treatment
•  Hillstrom Dataset :
•  For women models are comparable and useful
•  For men, there is no clear individuals to target
Evaluation: Qini
t (observa1ons)	
  
Evaluation: Qini
t (observa1ons)	
  
Conclusion
•  Uplift Modeling :
•  Surprisingly little literature / examples
•  The theory is rather easy to test
•  Two models
•  Class modification
•  The intuition and evaluation are not easy to grasp
•  On the client side :
•  A good lead to select the best offer for a customer
-> Can lead to more customer personalization
•  Applications :
•  Churn, mailing, retail couponing, personalized medicine…
Thank you for your attention !
A few references
•  Data :
•  Churn in gaming :
WOWAH dataset
•  Uplift for healthcare :
Colon Dataset
•  Uplift in mailing :
Hillstrom data challenge
•  Uplift in General :
Simulated data : available on gallery.dataiku.com
•  Demo :
•  http://gallery.dataiku.com/projects/DKU_UPLIFT/
A few references
•  Application
•  Uplift modeling for clinical trial data (Jaskowski, Jaroszewicz)
•  Uplift Modeling in Direct Marketing (Rzepakowski, Jaroszewicz)
•  Modeling techniques :
•  Rzepakowski Jaroszewicz 2011 (decision trees)
•  Soltys Rzepakowski Jaroszewicz 2013 (ensemble for uplift)
•  Jaskowski Jaroszewicz 2012 (Class modification model)
•  Evaluation
•  Using Control Groups to Target on Predicted Lift (Radcliffe)
•  Testing a New Metric for Uplift Models (Mesalles Naranjo)
A few references
•  Causal inference
•  Machine Learning Methods for Estimating Heterogeneous Causal Effects (Athey, Imbens 2015)
•  Introduction to Causal Inference (Sprites 2010)
•  Causal inference in statistics: An overview (Pearl 2009)

Más contenido relacionado

La actualidad más candente

Wayfair's Data Science Team and Case Study: Uplift Modeling
Wayfair's Data Science Team and Case Study: Uplift ModelingWayfair's Data Science Team and Case Study: Uplift Modeling
Wayfair's Data Science Team and Case Study: Uplift ModelingPatricia Stichnoth
 
Causality without headaches
Causality without headachesCausality without headaches
Causality without headachesBenoît Rostykus
 
Recap: Designing a more Efficient Estimator for Off-policy Evaluation in Band...
Recap: Designing a more Efficient Estimator for Off-policy Evaluation in Band...Recap: Designing a more Efficient Estimator for Off-policy Evaluation in Band...
Recap: Designing a more Efficient Estimator for Off-policy Evaluation in Band...Justin Basilico
 
Netflix talk at ML Platform meetup Sep 2019
Netflix talk at ML Platform meetup Sep 2019Netflix talk at ML Platform meetup Sep 2019
Netflix talk at ML Platform meetup Sep 2019Faisal Siddiqi
 
Homepage Personalization at Spotify
Homepage Personalization at SpotifyHomepage Personalization at Spotify
Homepage Personalization at SpotifyOguz Semerci
 
Recommender Systems
Recommender SystemsRecommender Systems
Recommender SystemsT212
 
Making Netflix Machine Learning Algorithms Reliable
Making Netflix Machine Learning Algorithms ReliableMaking Netflix Machine Learning Algorithms Reliable
Making Netflix Machine Learning Algorithms ReliableJustin Basilico
 
Deep Learning in Recommender Systems - RecSys Summer School 2017
Deep Learning in Recommender Systems - RecSys Summer School 2017Deep Learning in Recommender Systems - RecSys Summer School 2017
Deep Learning in Recommender Systems - RecSys Summer School 2017Balázs Hidasi
 
The How and Why of Feature Engineering
The How and Why of Feature EngineeringThe How and Why of Feature Engineering
The How and Why of Feature EngineeringAlice Zheng
 
Introduction to Recommendation Systems
Introduction to Recommendation SystemsIntroduction to Recommendation Systems
Introduction to Recommendation SystemsTrieu Nguyen
 
Calibrated Recommendations
Calibrated RecommendationsCalibrated Recommendations
Calibrated RecommendationsHarald Steck
 
Feature Importance Analysis with XGBoost in Tax audit
Feature Importance Analysis with XGBoost in Tax auditFeature Importance Analysis with XGBoost in Tax audit
Feature Importance Analysis with XGBoost in Tax auditMichael BENESTY
 
Deep Learning for Recommender Systems RecSys2017 Tutorial
Deep Learning for Recommender Systems RecSys2017 Tutorial Deep Learning for Recommender Systems RecSys2017 Tutorial
Deep Learning for Recommender Systems RecSys2017 Tutorial Alexandros Karatzoglou
 
Churn prediction data modeling
Churn prediction data modelingChurn prediction data modeling
Churn prediction data modelingPierre Gutierrez
 
Session-based recommendations with recurrent neural networks
Session-based recommendations with recurrent neural networksSession-based recommendations with recurrent neural networks
Session-based recommendations with recurrent neural networksZimin Park
 
Rishabh Mehrotra - Recommendations in a Marketplace: Personalizing Explainabl...
Rishabh Mehrotra - Recommendations in a Marketplace: Personalizing Explainabl...Rishabh Mehrotra - Recommendations in a Marketplace: Personalizing Explainabl...
Rishabh Mehrotra - Recommendations in a Marketplace: Personalizing Explainabl...MLconf
 
Feature Engineering
Feature EngineeringFeature Engineering
Feature EngineeringSri Ambati
 

La actualidad más candente (20)

Wayfair's Data Science Team and Case Study: Uplift Modeling
Wayfair's Data Science Team and Case Study: Uplift ModelingWayfair's Data Science Team and Case Study: Uplift Modeling
Wayfair's Data Science Team and Case Study: Uplift Modeling
 
Causality without headaches
Causality without headachesCausality without headaches
Causality without headaches
 
Recommender system
Recommender systemRecommender system
Recommender system
 
Recap: Designing a more Efficient Estimator for Off-policy Evaluation in Band...
Recap: Designing a more Efficient Estimator for Off-policy Evaluation in Band...Recap: Designing a more Efficient Estimator for Off-policy Evaluation in Band...
Recap: Designing a more Efficient Estimator for Off-policy Evaluation in Band...
 
Netflix talk at ML Platform meetup Sep 2019
Netflix talk at ML Platform meetup Sep 2019Netflix talk at ML Platform meetup Sep 2019
Netflix talk at ML Platform meetup Sep 2019
 
XGBoost & LightGBM
XGBoost & LightGBMXGBoost & LightGBM
XGBoost & LightGBM
 
Homepage Personalization at Spotify
Homepage Personalization at SpotifyHomepage Personalization at Spotify
Homepage Personalization at Spotify
 
Recommender Systems
Recommender SystemsRecommender Systems
Recommender Systems
 
Making Netflix Machine Learning Algorithms Reliable
Making Netflix Machine Learning Algorithms ReliableMaking Netflix Machine Learning Algorithms Reliable
Making Netflix Machine Learning Algorithms Reliable
 
Deep Learning in Recommender Systems - RecSys Summer School 2017
Deep Learning in Recommender Systems - RecSys Summer School 2017Deep Learning in Recommender Systems - RecSys Summer School 2017
Deep Learning in Recommender Systems - RecSys Summer School 2017
 
The How and Why of Feature Engineering
The How and Why of Feature EngineeringThe How and Why of Feature Engineering
The How and Why of Feature Engineering
 
Learn to Rank search results
Learn to Rank search resultsLearn to Rank search results
Learn to Rank search results
 
Introduction to Recommendation Systems
Introduction to Recommendation SystemsIntroduction to Recommendation Systems
Introduction to Recommendation Systems
 
Calibrated Recommendations
Calibrated RecommendationsCalibrated Recommendations
Calibrated Recommendations
 
Feature Importance Analysis with XGBoost in Tax audit
Feature Importance Analysis with XGBoost in Tax auditFeature Importance Analysis with XGBoost in Tax audit
Feature Importance Analysis with XGBoost in Tax audit
 
Deep Learning for Recommender Systems RecSys2017 Tutorial
Deep Learning for Recommender Systems RecSys2017 Tutorial Deep Learning for Recommender Systems RecSys2017 Tutorial
Deep Learning for Recommender Systems RecSys2017 Tutorial
 
Churn prediction data modeling
Churn prediction data modelingChurn prediction data modeling
Churn prediction data modeling
 
Session-based recommendations with recurrent neural networks
Session-based recommendations with recurrent neural networksSession-based recommendations with recurrent neural networks
Session-based recommendations with recurrent neural networks
 
Rishabh Mehrotra - Recommendations in a Marketplace: Personalizing Explainabl...
Rishabh Mehrotra - Recommendations in a Marketplace: Personalizing Explainabl...Rishabh Mehrotra - Recommendations in a Marketplace: Personalizing Explainabl...
Rishabh Mehrotra - Recommendations in a Marketplace: Personalizing Explainabl...
 
Feature Engineering
Feature EngineeringFeature Engineering
Feature Engineering
 

Similar a Beyond Churn Prediction : An Introduction to uplift modeling

Pp ts for machine learning
Pp ts for machine learningPp ts for machine learning
Pp ts for machine learningWrushali Mendre
 
An introduction to machine learning and statistics
An introduction to machine learning and statisticsAn introduction to machine learning and statistics
An introduction to machine learning and statisticsSpotle.ai
 
Bridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
Bridging the Gap: Machine Learning for Ubiquitous Computing -- EvaluationBridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
Bridging the Gap: Machine Learning for Ubiquitous Computing -- EvaluationThomas Ploetz
 
Statistical Learning and Model Selection (1).pptx
Statistical Learning and Model Selection (1).pptxStatistical Learning and Model Selection (1).pptx
Statistical Learning and Model Selection (1).pptxrajalakshmi5921
 
Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models ananth
 
Deep Q-learning from Demonstrations DQfD
Deep Q-learning from Demonstrations DQfDDeep Q-learning from Demonstrations DQfD
Deep Q-learning from Demonstrations DQfDAmmar Rashed
 
EMOD_Optimization_Presentation.pptx
EMOD_Optimization_Presentation.pptxEMOD_Optimization_Presentation.pptx
EMOD_Optimization_Presentation.pptxAliElMoselhy
 
Causal reasoning and Learning Systems
Causal reasoning and Learning SystemsCausal reasoning and Learning Systems
Causal reasoning and Learning SystemsTrieu Nguyen
 
Common mistakes in measurement uncertainty calculations
Common mistakes in measurement uncertainty calculationsCommon mistakes in measurement uncertainty calculations
Common mistakes in measurement uncertainty calculationsGH Yeoh
 
Dowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceDowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceAmit Sharma
 
Causality in Python PyCon 2021 ISRAEL
Causality in Python PyCon 2021 ISRAELCausality in Python PyCon 2021 ISRAEL
Causality in Python PyCon 2021 ISRAELHanan Shteingart
 
L1 intro2 supervised_learning
L1 intro2 supervised_learningL1 intro2 supervised_learning
L1 intro2 supervised_learningYogendra Singh
 
Setting up an A/B-testing framework
Setting up an A/B-testing frameworkSetting up an A/B-testing framework
Setting up an A/B-testing frameworkAgnes van Belle
 

Similar a Beyond Churn Prediction : An Introduction to uplift modeling (20)

Meetup_FGVA_Uplift @ Dataiku
Meetup_FGVA_Uplift @ DataikuMeetup_FGVA_Uplift @ Dataiku
Meetup_FGVA_Uplift @ Dataiku
 
ABTest-20231020.pptx
ABTest-20231020.pptxABTest-20231020.pptx
ABTest-20231020.pptx
 
Pp ts for machine learning
Pp ts for machine learningPp ts for machine learning
Pp ts for machine learning
 
An introduction to machine learning and statistics
An introduction to machine learning and statisticsAn introduction to machine learning and statistics
An introduction to machine learning and statistics
 
Bridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
Bridging the Gap: Machine Learning for Ubiquitous Computing -- EvaluationBridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
Bridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
 
Statistical Learning and Model Selection (1).pptx
Statistical Learning and Model Selection (1).pptxStatistical Learning and Model Selection (1).pptx
Statistical Learning and Model Selection (1).pptx
 
Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models
 
evaluation and credibility-Part 1
evaluation and credibility-Part 1evaluation and credibility-Part 1
evaluation and credibility-Part 1
 
Deep Q-learning from Demonstrations DQfD
Deep Q-learning from Demonstrations DQfDDeep Q-learning from Demonstrations DQfD
Deep Q-learning from Demonstrations DQfD
 
joe-olsen.pptx
joe-olsen.pptxjoe-olsen.pptx
joe-olsen.pptx
 
EMOD_Optimization_Presentation.pptx
EMOD_Optimization_Presentation.pptxEMOD_Optimization_Presentation.pptx
EMOD_Optimization_Presentation.pptx
 
Causal reasoning and Learning Systems
Causal reasoning and Learning SystemsCausal reasoning and Learning Systems
Causal reasoning and Learning Systems
 
Common mistakes in measurement uncertainty calculations
Common mistakes in measurement uncertainty calculationsCommon mistakes in measurement uncertainty calculations
Common mistakes in measurement uncertainty calculations
 
Dowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceDowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inference
 
Causality in Python PyCon 2021 ISRAEL
Causality in Python PyCon 2021 ISRAELCausality in Python PyCon 2021 ISRAEL
Causality in Python PyCon 2021 ISRAEL
 
L1 intro2 supervised_learning
L1 intro2 supervised_learningL1 intro2 supervised_learning
L1 intro2 supervised_learning
 
ai4.ppt
ai4.pptai4.ppt
ai4.ppt
 
Setting up an A/B-testing framework
Setting up an A/B-testing frameworkSetting up an A/B-testing framework
Setting up an A/B-testing framework
 
AL slides.ppt
AL slides.pptAL slides.ppt
AL slides.ppt
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 

Último

Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 

Último (20)

Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 

Beyond Churn Prediction : An Introduction to uplift modeling

  • 1. Beyond Churn Prediction : An Introduction to Uplift Modelling Pierre Gutierrez
  • 2. Plan •  Introduction / Client situation •  Uplift Use Cases •  Global Uplift Strategy •  Machine learning for Uplift •  Uplift Evaluation •  Conclusion Material •  Complete project http://gallery.dataiku.com/projects/DKU_UPLIFT/ •  Notebooks & Data https://github.com/PGuti/Uplift.git
  • 3. Dataiku •  Founded in 2013 •  60 + employees •  Paris, New-York, London, San Francisco DESIGN Load and prepare your data PREPARE Build your models MODEL Visualize and share your work ANALYSE Re-execute your workflow at ease AUTOMATE Follow your production environment MONITOR Get predictions in real time SCORE PRODUCTION Data Science Software Editor of Dataiku DSS
  • 5. Client situation •  Client : French Online Gaming Company (MMORPG) •  Users are leaving (more than 10 years old ) •  let’s do a churn prediction model ! •  Target : no come back in 14 or 28 days. (14 missing days -> 80 % of chance not to come back 28 missing days -> 90 % of chance not to come back) •  Features : •  Connection features : •  Time played in 1,7,15,30,… days •  Time since last connection •  Connection frequency •  Days of week / hours of days played •  Equivalent for payments and subscriptions •  Age, sex, country •  Number of account, is a bot … •  No in game features (no data)    
  • 6. Client situation •  Model Results : •  AUC 0.88 •  Very stable model in time •  Marketing actions : •  7 different actions based on customer segmentation (offers, promotion, … ) •  A/B test -> -5 % churn for persons contacted by email •  Going further : •  Feature engineering : guilds, close network, in game actions, … •  Study long term churn …
  • 7. Uplift Definition •  But wait ! •  Strong hypothesis : target the person that are the most likely to churn
  • 8. Uplift Definition •  But wait ! •  Strong hypothesis : target the person that are the most likely to churn •  What is the gain / person for an action ? •  cost of action •  fixed value of the customer •  independent variables •  “treated” population and “control” population •  •  Value with action : •  Value without action : •  Gain : c vi i X T C Y = ⇢ 1 if customer churn 0 otherwise ET (Vi) = vi(1 PT (Y = 1|X)) c EC (Vi) = vi(1 PC (Y = 1|X)) E(Gi) = vi(PC (Y = 1|X) PT (Y = 1|X)) c vi(hypothesis  :                      independent  of  ac1on)    
  • 9. Uplift Definition •  But wait ! •  Strong hypothesis : target the person that are the most likely to churn •  What is the gain / person for an action ? •  Real Target : People who are †he most likely to change positively their behavior if there is an action Upli5  =  Model   E(Gi) = vi(PC (Y = 1|X) PT (Y = 1|X)) c P
  • 10. Uplift Definition •  Gain to maximize: •  Targeting churner: Does not optimize the difference ! Is good if treatment good. •  Intuitive examples: •  : action is expected to make the situation worst. Spam ? •  : user does not care E(Gi) = vi(PC (Y = 1|X) PT (Y = 1|X)) c PC (Y = 1) ⇡ PT (Y = 1) PC (Y = 1) < PT (Y = 1)
  • 11. Uplift Definition If not treated Positive Response Negative Response Unnecessary costs Negative impact Positive Response Negative Response If treated Unnecessary costs The people we want to target SURE THINGS SLEEPING DOGS PERSUADABLES LOST CAUSES
  • 13. Uplift Use Cases •  Healthcare : •  Typical medical trial: •  Treatment group: gets the treatment •  Control group: gets placebo (or another treatment) •  Statistical test show that the treatment works or not globally •  With uplift modeling we can find out for whom the treatment works best •  Personalized medicine •  Ex : What is the gain in survival probability ? -> classification/uplift problem
  • 14. Uplift Use Cases •  Churn : •  E-gaming •  Other Ex : Coyote •  Retail : •  Compare effect of coupons campaigns •  Marketing / CRM : •  Churn •  E-Mailing
  • 15. Example •  Mailing : Hillstrom challenge •  2 campaigns : •  one men email •  one woman email •  Question : who are the people to target / that have the best response rate
  • 16. Uplift VS Causal Inference methods •  Causal inference closer to econometrics •  Uplift closer to ML, more practical •  Evaluation based on Cross Validation •  Usage of classical ML models •  Sometimes lack of theory •  Different people who don’t really talk together: •  Different Notations (sorry). Today is uplift’s •  Different evaluation functions •  Different models ? Not really !
  • 18. Uplift as a natural evolution Train  Data   Step 1 : train a (churn) model Training   Churn  Model  
  • 19. Uplift as a natural evolution Train  Data   Test  Data   A/B  test  on   scored  dataset   Step 2 : A/B test the model Training   Churn  Model  
  • 20. Uplift as a natural evolution Train  Data   Test  Data   A/B  test  on   scored  dataset   Step 3 : train your uplift model Training   Churn  Model   Training  
  • 21. Uplift as a natural evolution Train  Data   Test  Data   A/B  test  on   scored  dataset   New  scoring   Step 4 : deploy Training   Churn  Model   New  Test  Data   Upli5  Model   Training  
  • 22. Uplift as a natural evolution Train  Data   Test  Data   A/B  test  on   scored  dataset   New  scoring   Capitalize on your A/B test data ! Training   Churn  Model   New  Test  Data   Upli5  Model   Training   Today’s Focus
  • 24. Uplift modeling •  Three main methods in Uplift Literature: •  Two models approach •  Class variable modification •  Modification of existing machine learning models (tree based methods, out of the scope of today). •  Generalization: Causal inference approach •  Main Assumption (Uncofoundedness) : Control and Treatment belonging should be independent of the response
  • 25. Uplift modeling : Two model approach •  Build a model on treatment to get •  Build a model on control to get •  Set : PT (Y |X) PC (Y |X) P = PT (Y |X) PC (Y |X)
  • 26. Uplift modeling : Two model approach •  Advantages : •  Standard ML models can be used •  In theory, two good estimators -> a good uplift model •  Works well in practice •  Generalize to regression and multi-treatment easily •  Drawbacks •  Difference of estimators is probably not the best estimator of the difference •  The two classifier can ignore the weaker uplift signal (since it’s not their target) •  Algorithm focusing on estimating the difference should perform better
  • 27. Uplift modeling : Class variable transformation •  Introduced in Jaskowski, Jaroszewicz 2012 •  Allows any classifier to be updated to uplift modeling •  Let denote the group membership (Treatment or Control) •  Let’s define the new target variable : •  This corresponds to flipping the target in the control dataset. G 2 {T, C} Z = 8 < : 1 if G = T and Y = 1 1 if G = C and Y = 0 0 otherwise
  • 28. •  Why does it work ? •  By design (A/B test warning !), should be independent from •  Possibly with a reweighting of the datasets we should have : thus P(Z = 1|X) = PT (Y = 1|X)P(G = T|X) + PC (Y = 0|X)P(G = C|X) P(Z = 1|X) = PT (Y = 1|X)P(G = T) + PC (Y = 0|X)P(G = C) G X P(G = T) = P(G = C) = 1/2 2P(Z = 1|X) = PT (Y = 1|X) + PC (Y = 0|X) Uplift modeling : Class variable transformation
  • 29. •  Why does it work ? Thus And sorting by is the same as sorting by 2P(Z = 1|X) = PT (Y = 1|X) + PC (Y = 0|X) = PT (Y = 1|X) + 1 PC (Y = 1|X) P = 2P(Z = 1|X) 1 P(Z = 1|X) P Uplift modeling : Class variable transformation
  • 30. •  Summary : •  Flip class for control dataset •  Concatenate test and control dataset •  Build a classifier •  Target users with highest probability •  Advantages : •  Any classifier can be used •  Directly predict uplift (and not each class separately) •  Single model on a larger dataset (instead of two small ones) •  Drawbacks : •  Complex decision surface -> model can perform poorly Uplift modeling : Class variable transformation
  • 31. Generalization : •  From Athey: Y ? = Y G e(X) e(X)(1 e(X))Let •  Any classical estimator can be used •  Generalize to more advanced A/B test schemed •  Specific estimator can be derived (see paper) With E(Y ? = P)Then (Unconfoundedness) e(X) = P(G = 1|X)
  • 32. Uplift modeling : Other methods •  Based on decision trees : •  Rzepakowski Jaroszewicz 2012 new decision tree split criterion based on information theory •  Soltys Rzepakowski Jaroszewicz 2013 Ensemble methods for uplift modeling (out of today scope )
  • 34. Evaluation •  Problem : •  We don’t have a clear 0/1 target. •  We would need to know for each customer •  Response to treatment •  Response to control -> not possible •  Cross Validation : •  Train and Validation split •  Stratified on target/control variable.
  • 35. Evaluation: Uplift Decile / Bins •  Uplift bins: •  Sort dataset by predicted uplift descending •  Calculate uplift per bin •  Hard to compare models YT number of positive in treated YC number of positive in control NT number in treated NC number in control U = YT NT YC NC
  • 36. Evaluation: Uplift Decile / Bins •  Cumulative Uplift bins : •  Sort dataset by predicted uplift descending •  Calculate uplift on all bins preceding •  Cumulative Uplift Gain bins : •  Sort dataset by predicted uplift descending •  Calculate uplift on all bins preceding •  Multiply by number of instances
  • 37. Evaluation: Uplift Curve •  Generalization of the previous curve Parametric curve defined by: •  Similar to lift / ROC Curve •  Models can be compared ! AUC
  • 38. Evaluation: Qini •  Introduced in Radcliffe Parametric curve defined by: f(t) = YT (t) YC(t) ⇤ NT (t)/NC(t) t (observa1ons)  
  • 39. Evaluation: Qini •  Best model : •  Take first all positive in target and last all positive in control. •  No theoretic best model : •  depends on possibility of negative effect •  Displayed for no negative effect •  Random model : •  Corresponds to global effect of treatment •  Hillstrom Dataset : •  For women models are comparable and useful •  For men, there is no clear individuals to target
  • 42. Conclusion •  Uplift Modeling : •  Surprisingly little literature / examples •  The theory is rather easy to test •  Two models •  Class modification •  The intuition and evaluation are not easy to grasp •  On the client side : •  A good lead to select the best offer for a customer -> Can lead to more customer personalization •  Applications : •  Churn, mailing, retail couponing, personalized medicine…
  • 43. Thank you for your attention !
  • 44. A few references •  Data : •  Churn in gaming : WOWAH dataset •  Uplift for healthcare : Colon Dataset •  Uplift in mailing : Hillstrom data challenge •  Uplift in General : Simulated data : available on gallery.dataiku.com •  Demo : •  http://gallery.dataiku.com/projects/DKU_UPLIFT/
  • 45. A few references •  Application •  Uplift modeling for clinical trial data (Jaskowski, Jaroszewicz) •  Uplift Modeling in Direct Marketing (Rzepakowski, Jaroszewicz) •  Modeling techniques : •  Rzepakowski Jaroszewicz 2011 (decision trees) •  Soltys Rzepakowski Jaroszewicz 2013 (ensemble for uplift) •  Jaskowski Jaroszewicz 2012 (Class modification model) •  Evaluation •  Using Control Groups to Target on Predicted Lift (Radcliffe) •  Testing a New Metric for Uplift Models (Mesalles Naranjo)
  • 46. A few references •  Causal inference •  Machine Learning Methods for Estimating Heterogeneous Causal Effects (Athey, Imbens 2015) •  Introduction to Causal Inference (Sprites 2010) •  Causal inference in statistics: An overview (Pearl 2009)