All work

Customer churn prediction and retention analysis

For a subscription business, we built a churn prediction model and a retention analysis. The model scores every active customer for cancellation risk. The analysis shows how long customers stay, by plan and by signup month.

Client
Subscription business
Service
Predictive analysis
Data
12 months of history, 10,000+ records
Tools
Python, pandas, scikit-learn, PostgreSQL, matplotlib

The questions

  1. Which active customers are most likely to cancel in the next 30 days?
  2. What do customers do differently in the weeks before they cancel?
  3. Which plans and signup months keep customers longest?

Example outputs

Client data stays confidential, so these charts use sample numbers in the same format as the delivered reports.

  • 52%of cancellations fall in the top 10% of scored customers
  • 26%next-month churn in the high-risk band, against 5% overall
  • 29%of promo signups still subscribed after a year, against 55% on monthly plans

Signals ranked by importance

Permutation importance on the test months, scaled so the largest is 100.

  • Days since last login100
  • Fall in monthly sessions78
  • Failed payments, last 90 days64
  • Billed monthly, not annually51
  • Support tickets, last 90 days33
  • Joined on a promo27
  • Tenure in months18

Retention by signup month

Share of each month's signups still subscribed. M1 is one month after signup.

Signup monthM1M2M3M4M5M6
January87%80%75%72%70%67%
February86%79%74%71%69%
March88%82%77%74%
April81%72%66%
May86%79%
June87%

Retention by plan

Share of signups still subscribed, by months since signup. Promo means the customer joined on a promotional offer and is not counted in Monthly.

  • Annual
  • Monthly
  • Monthly, promo
0%25%50%75%100%024681012Annual, 0: 100%Annual, 1: 99%Annual, 2: 99%Annual, 3: 98%Annual, 4: 98%Annual, 5: 98%Annual, 6: 97%Annual, 7: 97%Annual, 8: 97%Annual, 9: 96%Annual, 10: 96%Annual, 11: 96%Annual, 12: 71%AnnualMonthly, 0: 100%Monthly, 1: 88%Monthly, 2: 80%Monthly, 3: 74%Monthly, 4: 70%Monthly, 5: 67%Monthly, 6: 64%Monthly, 7: 62%Monthly, 8: 60%Monthly, 9: 58%Monthly, 10: 57%Monthly, 11: 56%Monthly, 12: 55%MonthlyMonthly, promo, 0: 100%Monthly, promo, 1: 71%Monthly, promo, 2: 58%Monthly, promo, 3: 50%Monthly, promo, 4: 45%Monthly, promo, 5: 41%Monthly, promo, 6: 38%Monthly, promo, 7: 36%Monthly, promo, 8: 34%Monthly, promo, 9: 32%Monthly, promo, 10: 31%Monthly, promo, 11: 30%Monthly, promo, 12: 29%Monthly, promo0%25%50%75%100%036912Annual, 0: 100%Annual, 1: 99%Annual, 2: 99%Annual, 3: 98%Annual, 4: 98%Annual, 5: 98%Annual, 6: 97%Annual, 7: 97%Annual, 8: 97%Annual, 9: 96%Annual, 10: 96%Annual, 11: 96%Annual, 12: 71%Monthly, 0: 100%Monthly, 1: 88%Monthly, 2: 80%Monthly, 3: 74%Monthly, 4: 70%Monthly, 5: 67%Monthly, 6: 64%Monthly, 7: 62%Monthly, 8: 60%Monthly, 9: 58%Monthly, 10: 57%Monthly, 11: 56%Monthly, 12: 55%Monthly, promo, 0: 100%Monthly, promo, 1: 71%Monthly, promo, 2: 58%Monthly, promo, 3: 50%Monthly, promo, 4: 45%Monthly, promo, 5: 41%Monthly, promo, 6: 38%Monthly, promo, 7: 36%Monthly, promo, 8: 34%Monthly, promo, 9: 32%Monthly, promo, 10: 31%Monthly, promo, 11: 30%Monthly, promo, 12: 29%

Risk bands

Scored customers grouped by predicted risk, with the action for each band.

Risk bandShare of active customersCancel in the next 30 daysShare of all cancellationsAction
High10%26%52%Personal outreach this week
Medium25%7%35%Re-engagement emails
Low65%1%13%No contact, rescore next month
All customers100%5%100%

Approach

  1. 1

    Agree what churn means

    A cancellation request, a lapsed renewal and a card that fails for good are different events. The model needs one definition and one prediction window, such as the next 30 days.

  2. 2

    Take a snapshot for each month

    Record what was known about every active customer on the first day of the month, then whether they cancelled in the window. Nothing dated after the snapshot goes into the features, which stops the model from learning from the future.

  3. 3

    Build the features

    Days since last login, change in usage against the previous month, failed payments, support tickets, plan, tenure and how the customer joined.

  4. 4

    Train, then test on later months

    Fit a gradient-boosted classifier and compare it with a logistic regression baseline. Test both on the most recent months, which neither model has seen, and count how many real cancellations land in the top-scored 10% of customers.

  5. 5

    Calibrate and set the bands

    Check that customers scored at 25% do cancel about one time in four. Then cut the scores into bands sized to the number of customers the business can contact.

  6. 6

    Report retention

    Build retention curves by plan and a cohort table by signup month, refreshed on a schedule along with the scores.

Next projectOrder-level profitability analysisView project