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

Analyze the segments

Fantastic! Final step - analyzing your segmentation solution - you will analyze the average Recency, Frequency, MonetaryValue and Tenure values for each of the four segments you have built previously. Take some time to analyze them and understand what kind of customer groups and behaviors they represent.

The RFMT raw data is available as datamart_rfmt, and the cluster labels from the previous exercise is loaded as cluster_labels. We have also loaded the pandas library as pd.

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_rfmt.
  • Create a groupby element on a Cluster column.
  • Calculate average RFMT values and segment sizes per each Cluster value.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create a new DataFrame by adding a cluster label column to datamart_rfmt
datamart_rfmt_k4 = datamart_rfmt.____(Cluster=____)

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

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