6.1 Marketing Analysis Predicting Customer CHurn in Python
6.1 Marketing Analysis Predicting Customer CHurn in Python
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
Poor Service
Be er Price
Domain/industry knowledge
International calling
Customer usage
Customer churn
"no"
"yes"
pandas Foundations
df.head()
df.describe()
df.mean()
Mark Peterson
Senior Data Scientist, Alliance Data
Churners and non-churners
print(telco['Churn'].value_counts())
no 2850
yes 483
Name: Churn, dtype: int64
Mark Peterson
Senior Data Scientist, Alliance Data
Visualizing data in Python
seaborn library allows you to easily create informative and a ractive plots
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)
plt.show()
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)
plt.show()
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)
plt.show()
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)
plt.show()
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)
plt.show()
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)
plt.show()
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco)
plt.show()
sns.boxplot(x = 'Churn',
y = 'Account_Length',
data = telco,
sym="")
plt.show()
plt.show()