BaşlayınÜcretsiz Başlayın

Assign labels to raw data

You will now analyze the average RFM values of the three clusters you've created in the previous exercise. We have loaded the raw RFM dataset as datamart_rfm, and the cluster labels as cluster_labels. pandas is available as pd.

Feel free to explore the date in the console.

Bu egzersiz

Customer Segmentation in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create a new DataFrame by adding a cluster label column to datamart_rfm.
  • Create a groupby element on a Cluster column.
  • Calculate average RFM values and segment sizes per each Cluster value.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create a DataFrame by adding a new cluster label column
datamart_rfm_k3 = datamart_rfm.____(Cluster=cluster_labels)

# Group the data by cluster
grouped = ____.____(['____'])

# Calculate average RFM values and segment sizes per cluster value
grouped.____({
    'Recency': '____',
    'Frequency': '____',
    'MonetaryValue': ['____', '____']
  }).round(1)
Kodu Düzenle ve Çalıştır