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.
Este exercício faz parte do curso
Machine Learning for Marketing in Python
Instruções do exercício
- Group by
CustomerID
andInvoiceMonth
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.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# 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))