고객·제품 세분화 기초

Python으로 배우는 마케팅용 Machine Learning

Karolis Urbonas

Head of Analytics & Science, Amazon

데이터 형식

# Customer by product/service matrix
wholesale.head()

도·소매 데이터 헤더

Python으로 배우는 마케팅용 Machine Learning

비지도 학습 모델

  • 계층적 클러스터링
  • K-평균
  • 비음수 행렬 분해 (NMF)
  • 바이클러스터링
  • 가우시안 혼합 모형 (GMM)
  • 기타 다수
Python으로 배우는 마케팅용 Machine Learning

비지도 학습 모델

  • 계층적 클러스터링
  • K-평균
  • 비음수 행렬 분해 (NMF)
  • 바이클러스터링
  • 가우시안 혼합 모형 (GMM)
  • 기타 다수
Python으로 배우는 마케팅용 Machine Learning

비지도 학습 절차

  1. 모델 초기화
  2. 모델 학습(Fit)
  3. 군집 값 할당
  4. 결과 탐색
Python으로 배우는 마케팅용 Machine Learning

변수 탐색

wholesale.agg(['mean','std']).round(0)
        Fresh    Milk  Grocery  Frozen  Detergents_Paper  Delicassen
mean  12000.0  5796.0   7951.0  3072.0            2881.0      1525.0
std   12647.0  7380.0   9503.0  4855.0            4768.0      2820.0
# Get the statistics
averages = wholesale.mean()
st_dev = wholesale.std()
x_names = wholesale.columns
x_ix = np.arange(wholesale.shape[1])

# Plot the data import matplotlib.pyplot as plt plt.bar(x_ix-0.2, averages, color='grey', label='Average', width=0.4) plt.bar(x_ix+0.2, st_dev, color='orange', label='Standard Deviation', width=0.4) plt.xticks(x_ix, x_names, rotation=90) plt.legend() plt.show()
Python으로 배우는 마케팅용 Machine Learning

평균과 표준편차 막대그래프

막대 그래프

Python으로 배우는 마케팅용 Machine Learning

분포 탐색을 위한 페어플롯 시각화

import seaborn as sns
sns.pairplot(wholesale, diag_kind='kde')
plt.show()
Python으로 배우는 마케팅용 Machine Learning

페어플롯 검토

페어플롯 원본

Python으로 배우는 마케팅용 Machine Learning

연습해 봅시다!

Python으로 배우는 마케팅용 Machine Learning

Preparing Video For Download...