พื้นฐานการแบ่งกลุ่มลูกค้าและสินค้า

Machine Learning สำหรับการตลาดด้วย Python

Karolis Urbonas

Head of Analytics & Science, Amazon

รูปแบบข้อมูล

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

ส่วนหัวของชุดข้อมูล Wholesale

Machine Learning สำหรับการตลาดด้วย Python

โมเดล Unsupervised Learning

  • Hierarchical clustering
  • K-means
  • Non-negative matrix factorization (NMF)
  • Biclustering
  • Gaussian mixture models (GMM)
  • และอื่น ๆ อีกมาก
Machine Learning สำหรับการตลาดด้วย Python

โมเดล Unsupervised Learning

  • Hierarchical clustering
  • K-means
  • Non-negative matrix factorization (NMF)
  • Biclustering
  • Gaussian mixture models (GMM)
  • และอื่น ๆ อีกมาก
Machine Learning สำหรับการตลาดด้วย Python

ขั้นตอน Unsupervised Learning

  1. กำหนดค่าเริ่มต้น โมเดล
  2. ฝึก โมเดล
  3. กำหนด ค่าคลัสเตอร์
  4. สำรวจ ผลลัพธ์
Machine Learning สำหรับการตลาดด้วย Python

สำรวจตัวแปร

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()
Machine Learning สำหรับการตลาดด้วย Python

แผนภูมิแท่งแสดงค่าเฉลี่ยและส่วนเบี่ยงเบนมาตรฐาน

แผนภูมิแท่ง

Machine Learning สำหรับการตลาดด้วย Python

สร้าง Pairwise Plot เพื่อสำรวจการกระจายตัวของข้อมูล

import seaborn as sns
sns.pairplot(wholesale, diag_kind='kde')
plt.show()
Machine Learning สำหรับการตลาดด้วย Python

ทบทวน Pairwise Plot

Pairplot แบบดิบ

Machine Learning สำหรับการตลาดด้วย Python

มาฝึกกันเถอะ!

Machine Learning สำหรับการตลาดด้วย Python

Preparing Video For Download...