Predicting Churn

Sameer Mathur

Data Summary and Tables

IMPORTING AND REVIEWING THE DATA

Importing Data

library(ISLR)
library(data.table)
# reading data
pChurn.dt <- fread("2019CleanChurnData.csv")
attach(pChurn.dt)
# dimension of the dataset
dim(pChurn.dt)
[1] 6347   13

Reading Data columns

# names of the data columns 
colnames(pChurn.dt)
 [1] "ID"                    "Age"                  
 [3] "Churn"                 "CHIDec"               
 [5] "CHIChange"             "SupportCasesDec"      
 [7] "SupportCasesChange"    "SupportPriorityDec"   
 [9] "SupportPriorityChange" "LoginsChange"         
[11] "BlogPostsChange"       "ViewsChange"          
[13] "DaysSinceLoginChange" 

Data Structure

# structure of the data table
str(pChurn.dt)
Classes 'data.table' and 'data.frame':  6347 obs. of  13 variables:
 $ ID                   : int  1 1112 2223 3334 4445 5556 6015 6126 6237 1002 ...
 $ Age                  : int  58 58 52 57 54 55 54 42 53 53 ...
 $ Churn                : chr  "No" "No" "No" "No" ...
 $ CHIDec               : int  1 223 1 149 202 45 92 21 240 240 ...
 $ CHIChange            : int  1 179 1 95 2 3 53 8 75 39 ...
 $ SupportCasesDec      : int  1 1 1 2 1 1 2 1 2 1 ...
 $ SupportCasesChange   : int  1 1 1 2 1 1 20 1 11 1 ...
 $ SupportPriorityDec   : int  1 1 1 11 1 1 11 1 11 1 ...
 $ SupportPriorityChange: int  1 1 1 1 1 1 42 1 1 1 ...
 $ LoginsChange         : int  1 1 1 152 1 228 120 1 84 72 ...
 $ BlogPostsChange      : int  1 1 1 23 1 1 2 1 25 1 ...
 $ ViewsChange          : int  1 145 1 887 1331 319 1334 1044 1 989 ...
 $ DaysSinceLoginChange : int  134 134 134 1 134 1 1 139 141 115 ...
 - attr(*, ".internal.selfref")=<externalptr> 

Convert Data Type

# convert 'Churn' as a factor
pChurn.dt[, Churn := factor(Churn)]
# varifying conversion
str(pChurn.dt$Churn)
 Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...

Descriptive Statistics

# descriptive statistics of the dataframe
library(psych)
describe(pChurn.dt)[, c(1:5)]
                      vars    n    mean      sd median
ID                       1 6347 3174.00 1832.37   3174
Age                      2 6347   24.50   19.65     18
Churn*                   3 6347    1.05    0.22      1
CHIDec                   4 6347  103.14   92.67     73
CHIChange                5 6347   80.39   77.91     49
SupportCasesDec          6 6347    3.03    4.66      1
SupportCasesChange       7 6347    6.42    9.51      1
SupportPriorityDec       8 6347    3.60    4.36      1
SupportPriorityChange    9 6347    8.79   14.09      1
LoginsChange            10 6347  115.91   98.90     98
BlogPostsChange         11 6347    9.94   14.70      1
ViewsChange             12 6347  471.71  450.25    372
DaysSinceLoginChange    13 6347   52.80   58.47     11

Churn

Percentage of the Churn (Yes/No)

Churn
   No   Yes 
94.91  5.09 

Pie Chart for Percentage of the Churn(Yes/No)

plot of chunk unnamed-chunk-10

Customer Age

Age With Respect to Churn

   Churn AvgAge
1:    No  24.68
2:   Yes  21.20

Boxplot

plot of chunk unnamed-chunk-12

Mean Plot

plot of chunk unnamed-chunk-13

CHI - Customer Happiness Index

CHIDec & CHIChange With Respect to Churn

   Churn AvgCHIDec AvgCHIChange
1:    No    102.92        81.16
2:   Yes    107.16        66.07

Boxplot




plot of chunk unnamed-chunk-15




plot of chunk unnamed-chunk-16

Mean Plot




plot of chunk unnamed-chunk-17




plot of chunk unnamed-chunk-18

Support Cases, Support Priority

SupportCasesDec & SupportCasesChange With Respect to Churn

   Churn AvgSupportCasesDec AvgSupportCasesChange
1:    No               3.08                  6.52
2:   Yes               2.12                  4.59

Boxplot




plot of chunk unnamed-chunk-20




plot of chunk unnamed-chunk-21

Mean Plot




plot of chunk unnamed-chunk-22




plot of chunk unnamed-chunk-23

SupportPriorityDec & SupportPriorityChange With Respect to Churn

   Churn AvgSupportPriorityDec AvgSupportPriorityChange
1:    No                  3.66                     8.87
2:   Yes                  2.60                     7.44

Boxplot




plot of chunk unnamed-chunk-25




plot of chunk unnamed-chunk-26

Mean Plot




plot of chunk unnamed-chunk-27




plot of chunk unnamed-chunk-28

Usage Information

  • LoginChange

  • BlogPostChange

  • ViewsChange

  • DaysSinceLoginChange

Complite List of Variables

  • Churn
  • Age
  • CHIDec
  • CHIChange
  • SupportCasesDec
  • SupportCasesChange
  • SupportPriorityDec
  • SupportPriorityChange
  • LoginChange
  • BlogPostChange
  • ViewsChange
  • DaysSinceLoginChange