Machine Learning pentru Marketing în Python
Karolis Urbonas
Head of Analytics & Science, Amazon
Principala tipologie a churn-ului se bazează pe două modele de afaceri:


În general:
Churn/No Churn sau Yes/No - cea mai bună practică este transformarea în 1 și 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)
Separarea numelor de coloane după tipul de date
target = ['Churn']
custid = ['customerID']
cols = [col for col in telcom.columns if col not in custid + target]
Crearea seturilor de antrenament și test
train_X = train[cols]
train_Y = train[target]
test_X = test[cols]
test_Y = test[target]
Machine Learning pentru Marketing în Python