Cohort metrics

Customer Segmentation in Python

Karolis Urbonas

Head of Data Science, Amazon

Customer retention: cohort_counts table

  • How many customers originally in each cohort in the cohort_counts table?

$$

customer_counts_retention_1

Customer Segmentation in Python

Customer retention: cohort_counts table

  • How many customers originally in each cohort?
  • How many of them were active in following months?

customer_retention_2

Customer Segmentation in Python

Calculate retention rate

  1. Store the first column as cohort_sizes
    cohort_sizes = cohort_counts.iloc[:,0]
    
  2. Divide all values in the cohort_counts table by cohort_sizes
    retention = cohort_counts.divide(cohort_sizes, axis=0)
    
  3. Review the retention table
    retention.round(3) * 100
    
Customer Segmentation in Python

Retention table

retention_table

Customer Segmentation in Python

Other metrics

grouping = online.groupby(['CohortMonth', 'CohortIndex'])

cohort_data = grouping['Quantity'].mean()
cohort_data = cohort_data.reset_index()
average_quantity = cohort_data.pivot(index='CohortMonth', columns='CohortIndex', values='Quantity')
average_quantity.round(1)
Customer Segmentation in Python

Average quantity for each cohort

average_quantity

Customer Segmentation in Python

Let's practice on other cohort metrics!

Customer Segmentation in Python

Preparing Video For Download...