6.2 Marketing Analysis Predicting Customer CHurn in Python
6.2 Marketing Analysis Predicting Customer CHurn in Python
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
Model assumptions
Some assumptions that models make:
That the features are normally distributed
Account_Length int64
Vmail_Message int64
Day_Mins float64
Eve_Mins float64
Night_Mins float64
Intl_Mins float64
CustServ_Calls int64
Churn object
Intl_Plan object
Vmail_Plan object
Day_Calls int64
Day_Charge float64
Eve_Calls int64
Eve_Charge float64
Night_Calls int64
Night_Charge float64
Intl_Calls int64
Intl_Charge float64
State object
Area_Code int64
Phone object
dtype: object
0 no
1 no
2 no
3 yes
4 yes
Name: Intl_Plan, dtype: object
telco['Intl_Plan'].head() telco['Intl_Plan'].head()
0 0 0 0
1 0 1 0
2 0 2 0
3 1 3 1
4 1 4 1
Name: Intl_Plan, dtype: int64 Name: Intl_Plan, dtype: int64
0 0
0 KS 1 1
1 OH 2 2
2 NJ 3 1
3 OH Name: State, dtype: int64
Name: State, dtype: object
Bad idea
Calculates the number of standard deviations away from the mean each point is
df = StandardScaler().fit_transform(df)
Mark Peterson
Senior Data Scientist, Alliance Data
Dropping unnecessary features
Unique identi ers
Phone numbers
Account numbers
.drop() method