Python으로 배우는 마케팅용 Machine Learning
Karolis Urbonas
Head of Analytics & Science, Amazon
주요 이탈 유형은 두 가지 비즈니스 모델에 기반합니다:


일반적으로:
Churn/No Churn 또는 Yes/No일 수 있음 → 1/0으로 변환 권장set(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)
데이터 유형별로 열 이름 분리
target = ['Churn']
custid = ['customerID']
cols = [col for col in telcom.columns if col not in custid + target]
학습/테스트 데이터셋 구성
train_X = train[cols]
train_Y = train[target]
test_X = test[cols]
test_Y = test[target]
Python으로 배우는 마케팅용 Machine Learning