- A logistic regression model was found to best predict customer churn with the highest AUC and accuracy.
- The top variables increasing churn risk were credit class, handset price, average monthly calls, billing adjustments, household subscribers, call waiting ranges, and dropped/blocked calls.
- Cost and billing variables like charges and usage were significant, validating an independent survey.
- A lift chart showed targeting the highest risk 30% of customers could identify 33% of potential churners. The model allows prioritizing retention efforts on the 20% riskiest customers.
Predict customer churn with logistic regression and ensemble modeling
1. Pranov Shobhan Mishra
Prediction of customer propensity to churn
TELECOM INDUSTRY
Refer to github link for the code
https://github.com/Pranov1984/Prediction-of-customer-propensity-to-churn
2. Executive Summary
Overview:
At company X, there is a concern that there is an increased churn being experienced by all companies in the
telecom industry. Customer retention and Average revenue per unit (ARPU) has become a strong area of focus,
especially for company X, as the churn rate for X, has been relatively high.
Problem Statement:
Currently the effort to retain customers has been very reactive as the attempt is made only when the subscriber
calls in to close the account. The management team is keen to take more initiatives on this front and have a
targeted proactive strategy.
Goal Statement:
The aim of this project is to do a data analysis and help the company with insights on customer behaviour that
would be helpful in devising targeted strategies for retention of customers. The specific goals expected to be
achieved are given below
Identification of the top variables driving likelihood of churn
An independent industry survey suggested that “cost and billing”, “network and service quality” and “data usage
connectivity issues” are key influencing factors of churn. Validate if this holds true for Company X.
Build a predictive model to identify customers who have highest probability of churn that the company can use for
proactive retention strategy.
Build a lift chart so that the company can optimize their efforts by targeting most of the potential churns with
least contact efforts. Here with 30% of the total customer pool, the model accurately provides 33% of total
potential churn candidates.
3. Executive Summary Continued ...
Extensive experimentation with more than 10 different models was done to identify the best model that could
predict customer behaviour so that the company can take proactive steps to retain the customer wherever
possible.
The data was slightly imbalanced (Majority class: Minority Class = 76:24) and hence appropriate model evaluation
metric was required to be chosen. A combination of Harmonic mean (F1 score) and Area Under the Curve (AUC)
was used to finalize the best model.
Models tried to arrive at the best are
Simple Models like Logistic Regression & Discriminant Analysis with different thresholds for classification
Random Forest after balancing the dataset using Synthetic Minority Oversampling Technique (SMOTE)
Ensemble of five individual models and predicting the output by averaging the individual output probabilities
Xgboost algorithm
Note: Ensemble model with majority and stacked ensemble were also tried but they did not give good results and hence not included in the project report
The key insights as provided by the logistic regression model, which incidentally provided the best metrics,
indicate that the variables that impact customer behaviour can be broadly classified as below:
minutes of usage(both in terms of duration and number of calls),
overage charges,
network quality (for both voice and data),
number of subscribers in the family,
handset price and
credit class
A Gains chart was prepared which gave a cumulative lift of 110% in the first 3 deciles. The customers with highest
probability of churn were identified. The company could use the customer details to proactively work with them
and retain them.
4. Approach
• Variables
greater than
30% missing
values
Remove
Variables
• Identify
Significant
variables using
Boruta
Feature
Selection
• kNN used on
dataset with
significant
variables
Missing Value
Imputation
• Winsor &
Variable
Transformation
Outlier
Treatment
Model Building
Logistic Regression
Linear Discriminant Analysis
Random Forest
Ensemble Models – Averaging the output from each individual model
Ensemble Models – Majority Voting
Stacked Ensemble Models
Boosting – Xgboost
7. Significant Variables, Missing Value Imputation & Outlier Treatment
The above variables were removed from the original dataset and then a boruta model was built for feature selection
purposes. The model identified the significant variables which was used to further subset the original dataset.
The significant variables were, as identified, given below
8. Correlation Plot highlighting the correlated numeric variables
Highly correlated variables
that was considered for
removal to reduce multi-
collinearity
9. Significant Variables, Missing Value Imputation & Outlier Treatment
Further sub setting the original with by selecting the significant variables, we still have 50 variables, with 18 of them
still having missing values.
The missing values were treated by using kNN algorithm to predict the missing values. Library VIM was used.
After that some of the highly correlated variables were removed.
Most of the numeric variables had outliers. The boxplots as can be seen when the code is run, help visualize the
variables with outliers.
The outliers were treated by winsorizing the variables. Library Desctools was used. Some variables were further log
transformed. See the r code for more details.
10. Data Visualization
Similar trend for customers who churn and who do not. Higher no. of
customers with low usage and high mean usage.
For customers who churn, the trend is generally decreasing after a value of
30. Customers who don’t churn, the trend is decreasing after close to 50.
Similar pattern in rev_Range for both customer behaviors
Similar pattern but differences in densities noticeable for comparable values.
11. Data Visualization
Similar trend for both customer behavior.
Similar pattern in rev_Range for both customer behaviors
Similar pattern but differences in densities noticeable for comparable values.Similar pattern but differences in densities noticeable for comparable values.
12. Data Visualization – Using Transformed Variables
Distinct differentiation noticed in customer behavior across models and
Months of usage.
Similarly for Call Drops also as seen below
Distinct differentiation achieved for both the variables after transformation
to two classes based on churn percentage
14. Model Comparison – The previously build models and an Ensemble Model
Ensemble of five Individual models and final prediction was done by averaging the predictions from the models
15. Model Comparison with Ensemble Modelling
Five Individual models built and final prediction was done by combining the predictions from the models
16. Model Comparison
Ten models tried to finalize the best amongst them. The evaluation metric comparison seen
above
LG_26 seems to be giving the best results with highest AUC, second highest accuracy and
relatively good sensitivity and specificity
LG_26 is a logistic regression model with a threshold of cut-off for levels chosen at 26%
17. Variables with more than 50% probability of changing the decision of the customer for every 1 unit
change in the respective independent variable
Top ten factors for customer churn are
1. crcscod (Credit Class Code),
2. hnd_price (current handset price),
3. avgqty, (average monthly number of calls over the life of customer) ,
4. adjmou (Billing adjusted total minutes of use over the life of customer),
5. Uniqsubs (Number of unique subscribers in the household),
6. callwait_range, (Range of number of call waiting calls)
7. Datovr_Range, Range of revenue of data overage
8. Drop_blk_Mean, Mean number of dropped or blocked calls
9. Drop_vce_Range, Range of number of dropped (failed) voice calls
10. rev_range, Range of revenue(charge amount)
18. Validation of applicability of Independent Survey Finding for the Telecom Industry (Refer the Executive summary)
Shown below is the summary of the Logistic model used with each variable’s significance status.
Variables impacting cost and billing are highly significant. Adjmou has one of the top 5 odds ratio.
Mean total monthly recurring charge (totmrc_Mean), Revenue (charge amount) Range (rev_Range), adjmou (Billing adjustments) etc are
found to be highly significant, suggesting cost and billing impact customer behaviour.
Similarly network and service quality variables like drop_bkl_Mean (mean no. of dropped and blocked calls) is highly significant,
drop_vce_Range is significant, whereas callwait_mean is significant at alpha = 10%.
Datovr_Range(Range of revenue of data overage) is not found to be significant but has an odds ratio of more than 1 indicating that 1 unit
change in its value has more than 50% chance of changing the customer behaviour from one level to other, thereby suggesting the need to pay
attention to it. Additionally the intercept is significant which constitutes effects of levels of categorical variables that were removed by the
model.
19. Recommend rate plan migration as a proactive retention strategy?
The analysis below suggests an answer as “Yes”.
Mou_Mean (minutes of usage) is one of the highly significant variables as was seen in the previous slide and hence it makes sense to work
toward proactively working with customers to increase their MOU so that they are retained for a longer period.
The below boxplot also suggests that customers who are retained seem to have higher MOU.
Additionally mouR_Factor is found to be highly significant which is a derived variable of mou_Range.
Changes in MOU is also highly significant. Change_mF is a derived variable of change_mou.
To complement the above we also see that ovrmou_Mean is also a highly significant variable with an odds ration of more than 1. The variable
has positive estimate of coefficient indicating increase in overage increases churn.
It would help if the company is able to work with the customers and based on their usage migrate them to optimal plan rates to avoid overage
charges.
20. Use of model for prioritisation of customers for a proactive retention campaigns
Gains – Lift Chart
The lift achieved will help to reach out to churn candidates by targeting much fewer of the total
customer pool with the company. The highest gain can be achieved through the first 30 deciles which
can give about 33% of the customers who are likely to terminate the services. This means the company
selects 30% of entire customer database and that covers 33% of people who are likely to leave. This is
much better than randomly calling customers in the absence of model which would have given maybe
15% hit rate from all potential churn candidates.
21. Identification of the customers with highest probability of terminating services
The 20% customers who need to be proactively worked with to prevent churn were identified with.
They are the customers whose probability of churn is greater than 32.24% and less than 84.7. The code
to get the customer details is given below
gains(as.numeric(Telecom_Winsor$churn),predict(LGMF,type="response",newdata=Telecom_Winsor[,-42]),groups = 10)
Telecom_Winsor$Cust_ID=mydata$Customer_ID
Telecom_Winsor$prob<-predict(LGMF,type="response",newdata=Telecom_Winsor[,-42])
quantile(Telecom_Winsor$prob,prob=c(0.10,0.20,0.30,0.40,0.50,0.60,0.70,0.80,0.90,1))
targeted=Telecom_Winsor%>%filter(prob>0.3224491 & prob<=0.8470540)%>%dplyr::select(Cust_ID)