Study · 04 — Lab

B2B customer churn prediction

A model to anticipate which wholesale customers are about to stop buying.

System view · demo data

Customers by churn probability23 of 146 flagged02040threshold 0.500.000.250.500.751.00■ left □ stayed

Drag the dashed line · ← → with the chart focused

Customers to contact
23
Precision
87%
Recall
50%

At 0.50 you contact 23 of 146 customers. Out of every 10 contacted, 9 were really leaving, and you reach 20 of the 40 who left. Lowering the threshold saves more customers at the cost of calling more people who were staying.

The problem

Losing a B2B customer becomes obvious only once they are gone.

What I built

Out-of-time validation, RFM features with trend, logistic regression against Random Forest and LightGBM, and interpretation with SHAP.

What changed

The model returns a risk ranking together with the reasons behind each case.

Tools

  • Python
  • LightGBM
  • SHAP