LoslegenKostenlos loslegen

Calculate traditional CLV

Now you will calculate one of the most popular descriptive CLV models that accounts for the retention and churn rates. This gives a more robust estimate, but comes with certain assumptions that have to be validated. Make sure you review the video slides before you apply this method to your own use case.

The pandas and numpy libraries have been loaded as pd as np respectively. The online and retention datasets have been imported for you.

Diese Übung ist Teil des Kurses

Machine Learning for Marketing in Python

Kurs anzeigen

Anleitung zur Übung

  • Group by CustomerID and InvoiceMonth and calculate monthly spend per customer.
  • Calculate average monthly retention rate.
  • Calculate average monthly churn rate.
  • Calculate traditional CLV by multiplying monthly average spend with retention to churn ratio.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Calculate monthly spend per customer
monthly_revenue = online.___(['CustomerID','InvoiceMonth'])['___'].sum().mean()

# Calculate average monthly retention rate
retention_rate = retention.iloc[:,1:].mean().mean()

# Calculate average monthly churn rate
churn_rate = 1 - ___

# Calculate traditional CLV 
clv_traditional = monthly_revenue * (___ / churn_rate)

# Print traditional CLV and the retention rate values
print('Average traditional CLV is {:.1f} USD at {:.1f} % retention_rate'.format(clv_traditional, retention_rate*100))
Code bearbeiten und ausführen