Pythonで学ぶマーケティングのための機械学習
Karolis Urbonas
Head of Analytics & Science, Amazon
主な分類は2つのビジネスモデルに基づく:


一般に:
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で学ぶマーケティングのための機械学習