Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customer Lifetime Value (CLV) Analysis

Project Type: Descriptive + Simple Predictive Analysis

This project has two parts. First, a descriptive analysis of the revenue customers have already generated historically. Second, a simple predictive projection of what each customer segment is expected to be worth going forward, using a standard formula-based approach (not machine learning).

Business Question

For a subscription-based service, what is each customer segment actually worth over their lifetime — both historically (revenue already earned) and going forward (projected future value, given how likely that segment is to churn)? Which segments should retention investment prioritize, based on where the most future value is at risk?

Why This Matters

A segment might look valuable based on historical revenue alone, but if that segment also churns quickly, its true future value could be much lower than it appears — or vice versa. Combining historical and projected value gives a more complete, decision-ready picture than either view alone.

Key Findings

Descriptive CLV

Contract Type Avg Historical CLV Avg Monthly Revenue
Month-to-month $1,369.25 $66.40
One year $3,032.62 $65.05
Two year $3,706.93 $60.77

Month-to-month customers pay the highest average monthly rate, while Two-year customers pay the lowest — yet Two-year customers accumulate far more total value simply by staying longer. Viewed by monthly rate alone, Month-to-month looks more valuable; viewed by total historical revenue, it looks least valuable. Neither view alone tells the full story.

Predictive CLV

Projecting forward using Average Monthly Revenue ÷ Monthly Churn Rate tells a very different story:

Contract Type Monthly Churn Rate Predicted CLV
Month-to-month 42.71% $155.47
One year 11.27% $577.20
Two year 2.83% $2,147.35

Predicted CLV for Month-to-month customers is roughly 13x lower than their historical average. This gap is explained by survivorship bias: historical averages only reflect customers who already stayed long enough to be counted, while predicted CLV reflects the true expected value of a typical new customer, given how quickly that segment actually churns.

Historical vs Predicted CLV

Statistical Validation

A one-way ANOVA confirmed average CLV differs significantly across contract types (F = 920.33, p < 0.0001) — not a chance pattern in this sample.

Recommendations

  1. Do not use historical CLV alone to judge segment value. It overstates the true expected worth of high-churn segments. Predicted CLV should be the primary metric for forward-looking decisions like acquisition spend or retention budget allocation.
  2. Month-to-month customers generate the highest revenue per month but the lowest lifetime value. They are poor long-term retention targets unless that investment specifically reduces their churn rate — resources are likely better spent converting them to longer contracts.
  3. Two-year contract customers are dramatically more valuable when projected forward. Prioritizing contract conversion is likely the single highest-leverage lever for increasing overall customer value.

Limitations

  • The predictive CLV formula assumes each segment's current churn rate stays constant going forward — a simplification. Real churn rates can shift due to market conditions, competitor actions, or product changes.
  • Churn is treated as representing monthly churn — an assumption appropriate for this dataset's structure, but worth stating explicitly since it directly drives the predictive calculation.
  • This analysis does not account for acquisition cost — high predicted CLV alone doesn't justify pursuing a segment if the cost to acquire those customers is also disproportionately high.

Dataset

IBM Telco Customer Churn (public dataset via Kaggle). 7,043 customers, one row each, including tenure, contract type, monthly/total charges, and churn status.

Methodology

  1. Extraction (src/etl.py) — raw CSV loaded into DuckDB; relevant columns extracted via SQL.
  2. Cleaning (src/etl.py) — numeric columns converted from text; a small number of blank TotalCharges values (brand-new customers) filled with 0.
  3. Bucketing (src/etl.py) — customers grouped into 5 tenure ranges using pd.cut().
  4. Descriptive CLV (src/analysis.py) — average historical revenue and monthly rate calculated per segment.
  5. Predictive CLV (src/analysis.py) — projected future value calculated per segment using Average Monthly Revenue ÷ Monthly Churn Rate.
  6. Statistical testing (src/analysis.py) — one-way ANOVA confirming CLV differences across contract types are statistically significant.
  7. Compare descriptive vs. predictive CLV to identify segments that are over- or under-valued when future risk is accounted for.
  8. Run a statistical test (ANOVA) to confirm whether CLV genuinely differs across contract types.
  9. Provide business recommendations combining both views.

Project Structure

customer-lifetime-value-analysis/ ├── data/ │ └── raw/ │ └── telco_churn.csv ├── notebooks/ │ └── 01_clv_analysis.ipynb # full narrated walkthrough ├── src/ │ ├── etl.py # load, clean, bucket │ └── analysis.py # descriptive/predictive CLV, charts, ANOVA └── outputs/ └── figures/ ├── clv_by_contract.png ├── clv_by_tenure.png └── clv_historical_vs_predicted.png

How to Run

# 1. Set up environment
python -m venv venv
source venv/Scripts/activate    # Windows Git Bash
pip install -r requirements.txt

# 2. Load, clean, and bucket the data
python src/etl.py

# 3. Run the full CLV analysis (descriptive, predictive, statistical test)
python src/analysis.py

Alternatively, open notebooks/01_clv_analysis.ipynb for a narrated, cell-by-cell walkthrough with inline charts and explanations.

Tech Stack

Python, pandas, DuckDB, SQL, Matplotlib, Seaborn, SciPy

About

Descriptive and formula-based predictive CLV analysis, revealing how survivorship bias inflates historical customer value estimates for high-churn segments. Built with Python, DuckDB, SQL, and pandas.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages