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

Build retention and churn tables

You have learned the main elements of the customer lifetime value calculation and certain variations of it. Now you will use use the monthly cohort activity dataset to calculate retention and churn values, which you will then explore and later use to project average customer lifetime value.

The pandas library has been loaded as pd and the cohorts_counts dataset has been imported. Feel free to explore it in the console.

Bu egzersiz

Machine Learning for Marketing in Python

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

Egzersiz talimatları

  • Extract cohort sizes from the first column of cohort_counts.
  • Calculate retention by dividing the cohort counts with the cohort sizes.
  • Calculate churn by subtracting 1 and the retention rates.
  • Print the retention table.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Extract cohort sizes from the first column of cohort_counts
cohort_sizes = cohort_counts.___[:,0]

# Calculate retention by dividing the counts with the cohort sizes
retention = cohort_counts.___(cohort_sizes, axis=0)

# Calculate churn
churn = 1 - ___

# Print the retention table
print(___)
Kodu Düzenle ve Çalıştır