Retention और Churn टेबल्स बनाएँ
आपने कस्टमर लाइफटाइम वैल्यू (CLV) की गणना के मुख्य तत्व और उसकी कुछ विविधताएँ सीखी हैं. अब आप monthly cohort activity डेटासेट का उपयोग करके retention और churn मान निकालेंगे. फिर आप इन्हें explore करेंगे और आगे चलकर औसत कस्टमर लाइफटाइम वैल्यू प्रोजेक्ट करने में इस्तेमाल करेंगे.
pandas लाइब्रेरी pd के रूप में लोड है और cohorts_counts डेटासेट इम्पोर्ट किया जा चुका है. आप कंसोल में इसे बेझिझक explore कर सकते हैं.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में मार्केटिंग के लिए मशीन लर्निंग
अभ्यास निर्देश
cohort_countsकी पहली कॉलम से cohort sizes निकालें.- Cohort counts को cohort sizes से divide करके retention निकालें.
- Retention rates से 1 घटाकर churn निकालें.
- Retention टेबल प्रिंट करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# 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(___)