0% found this document useful (0 votes)
121 views

6.1 Marketing Analysis Predicting Customer CHurn in Python

This document introduces a course on marketing analytics and predicting customer churn in Python. It discusses different types of customer churn like contractual, voluntary, and involuntary churn. It also describes the telco churn dataset that will be used, which contains records on 3,333 customers, their service usage and whether they churned. The document outlines exploring the data using pandas and visualizing it using seaborn to better understand differences between churners and non-churners.

Uploaded by

murari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views

6.1 Marketing Analysis Predicting Customer CHurn in Python

This document introduces a course on marketing analytics and predicting customer churn in Python. It discusses different types of customer churn like contractual, voluntary, and involuntary churn. It also describes the telco churn dataset that will be used, which contains records on 3,333 customers, their service usage and whether they churned. The document outlines exploring the data using pandas and visualizing it using seaborn to better understand differences between churners and non-churners.

Uploaded by

murari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Welcome to the

course
M A R K E T I N G A N A LY T I C S : P R E D I C T I N G C U S T O M E R C H U R N I N P Y T H O N

Mark Peterson
Senior Data Scientist, Alliance Data
Churn Analytics

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON
Customer churn
When an existing customer stops doing business with a company

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Contractual churn

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Voluntary churn

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Non-contractual churn

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Involuntary churn: Credit card expiration

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Involuntary churn: Utilities turned off

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Utilizing your experience
Customer
Lack of usage

Poor Service

Be er Price

Domain/industry knowledge

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Telco Churn Dataset
Description Value
Records 3333
Features 21
Continous 15
Categorical 6

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Features of interest
Voice mail

International calling

Cost for the service

Customer usage

Customer churn

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


How churn is defined here
Customer cancelling their cellular plan at a given point in time

"no"

"yes"

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Exploratory data analysis using pandas
Understand the features of the dataset

Compute summary statistics

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Exploratory data analysis using pandas

pandas Foundations

df.head()

df.describe()

df.mean()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Let's explore the
data!
M A R K E T I N G A N A LY T I C S : P R E D I C T I N G C U S T O M E R C H U R N I N P Y T H O N
Grouping and
summarizing data
M A R K E T I N G A N A LY T I C S : P R E D I C T I N G C U S T O M E R C H U R N I N P Y T H O N

Mark Peterson
Senior Data Scientist, Alliance Data
Churners and non-churners
print(telco['Churn'].value_counts())

no 2850
yes 483
Name: Churn, dtype: int64

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Model outcomes
Two classes:

'yes' : Customer will churn

'no' : Customer will not churn

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Differences between churners and non-churners
Do churners call customer service more o en?

Does one state have more churners compared to another?

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Grouping and summarizing data
.groupby()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Let's group and
summarize!
M A R K E T I N G A N A LY T I C S : P R E D I C T I N G C U S T O M E R C H U R N I N P Y T H O N
Exploring your data
using visualizations
M A R K E T I N G A N A LY T I C S : P R E D I C T I N G C U S T O M E R C H U R N I N P Y T H O N

Mark Peterson
Senior Data Scientist, Alliance Data
Visualizing data in Python
seaborn library allows you to easily create informative and a ractive plots

Builds on top of matplotlib

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Visualizing the distribution of account lengths
Important to understand how your variables are distributed

import matplotlib.pyplot as plt


import seaborn as sns
sns.distplot(telco['Account_Length'])
plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON
Differences in account length
Box plot

sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Differences in account lengths
Box plot

sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Differences in account lengths
Box plot

sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Differences in account lengths
Box plot

sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Differences in account lengths
Box plot

sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Differences in account lengths
Box plot

sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Differences in account length
Box plot

sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Differences in account length
Box plot

sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco,
sym="")

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Adding a third variable
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco,
hue = 'Intl_Plan')

plt.show()

MARKETING ANALYTICS: PREDICTING CUSTOMER CHURN IN PYTHON


Let's make some
plots!
M A R K E T I N G A N A LY T I C S : P R E D I C T I N G C U S T O M E R C H U R N I N P Y T H O N

You might also like