Machine Learning pour le marketing en Python
Karolis Urbonas
Head of Analytics & Science, Amazon
La typologie principale du churn repose sur deux modèles d'affaires :


En général :
Churn/No Churn ou Yes/No ; bonne pratique : convertir en 1 et 0set(telcom['Churn'])
{0, 1}
telcom.groupby(['Churn']).size() / telcom.shape[0] * 100
Churn
0 73.421502
1 26.578498
dtype: float64
from sklearn.model_selection import train_test_split
train, test = train_test_split(telcom, test_size = .25)
Séparer les noms de colonnes par type de données
target = ['Churn']
custid = ['customerID']
cols = [col for col in telcom.columns if col not in custid + target]
Créer les ensembles d'entraînement et de test
train_X = train[cols]
train_Y = train[target]
test_X = test[cols]
test_Y = test[target]
Machine Learning pour le marketing en Python