📉 Customer Churn Predictor — Survival Curve Live
Watch a survival-analysis model estimate each customer's churn hazard over time from usage and support signals, and see the cohort survival curve update as you adjust retention levers.
About the Customer Churn Predictor
Predicting churn is fundamentally a question about when, not just whether: a customer who has been active for eighteen months and a customer who joined last week are not equally at risk even if both look "engaged" today, and a customer who is still subscribed at the end of your observation window has not necessarily stayed loyal forever -- they are simply censored, meaning their true outcome is not yet known. Survival analysis is the branch of statistics built to handle exactly this kind of time-to-event data correctly. This simulation builds a synthetic cohort of subscription customers, assigns each one a genuine Cox-proportional-hazards-style hazard function driven by usage decline, accumulated support tickets, tenure and whether a retention discount has been applied, and then simulates real monthly churn events from that hazard. A Kaplan-Meier estimator is computed directly from the resulting event history, exactly the way a churn analytics team would compute it from real subscription logs.
🔬 What it shows
Every customer in the cohort carries a live hazard score built from their own accumulated usage-decline index, support-ticket load and tenure, combined with a shared Weibull baseline hazard. Each simulated month, every still-active customer faces a real Bernoulli churn draw with probability 1 − e^(−hazard). The resulting per-month event counts feed a genuine Kaplan-Meier estimator, S(t) = S(t−1) × (1 − d_t/n_t), rendered as a live step-function survival curve alongside a no-intervention baseline for comparison.
🎮 How to use
Drag Proactive Discount Rate and Support Responsiveness to see the hazard equation itself change — both feed straight into the exponent of every customer's Cox-style hazard, so the cohort's Kaplan-Meier curve reshapes immediately against the same underlying random draws. Set the Intervention Threshold to decide how much accumulated risk a customer needs before they become discount-eligible. Switch the cohort grid between Risk, Status and Tenure views, click any customer for their individual hazard breakdown, and use Play / Step / Reset to move through the three-year horizon.
💡 Did you know?
The Kaplan-Meier estimator, published by Edward Kaplan and Paul Meier in 1958, is one of the most cited statistics papers ever written precisely because it solved the censoring problem cleanly: instead of throwing away customers (or patients) who hadn't yet experienced the event by the end of the study, it multiplies together the conditional survival probability at every observed event time, using exactly the customers still at risk at that moment. The same equation used here to build a subscription cohort's survival curve is used, unmodified, in clinical trials to report five-year survival rates.
Frequently asked questions
What is survival analysis and why is it used for churn?
Survival analysis is a family of statistical methods for modeling the time until an event happens — originally time until death in medical studies, but the same machinery applies to time until a customer cancels a subscription. Unlike a simple yes/no classifier, survival models handle censoring gracefully: customers who are still active at the end of the observation window have not churned yet, but they might in the future, and a survival model treats that uncertainty correctly instead of discarding those customers or mislabeling them as loyal. This simulation builds a synthetic cohort, assigns each customer a hazard function driven by real features, and estimates the cohort survival curve with the Kaplan-Meier estimator, exactly as a churn analytics team would on real subscription data.
What is a hazard function and how is it computed here?
The hazard function h(t) is the instantaneous risk that a customer churns at time t, given that they have survived up to t. This simulation uses a Cox-proportional-hazards-style model: h_i(t) = h0(t) × exp(β1·usage_decline_i(t) + β2·support_tickets_i(t) − β3·tenure_i(t) − β4·discount_applied_i), where h0(t) is a Weibull baseline hazard shared by every customer and the exponential term is a per-customer risk multiplier built from that customer's actual accumulated usage decline, support-ticket load, tenure and whether a retention discount has been applied. Every month the simulation draws a Bernoulli churn event for each active customer with probability 1 − e^(−h_i(t)), so the hazard genuinely drives who leaves and when.
How does the Kaplan-Meier survival curve get built from simulated events?
At every monthly time step the simulation records n_t, the number of customers still at risk (not yet churned) at the start of the month, and d_t, the number of churn events that occur during that month. The Kaplan-Meier estimator then updates the cohort survival probability as S(t) = S(t−1) × (1 − d_t/n_t), a running product of one-minus-the-hazard-rate at every step where an event was observed. This is the same non-parametric estimator used in real churn and clinical survival studies — it is derived directly from the simulated event history rather than being a pre-drawn decorative curve, so tightening or loosening the hazard genuinely reshapes it.
What do the retention lever sliders actually change?
Proactive Discount Rate sets the probability that a customer whose risk score crosses the Intervention Threshold receives a targeted retention discount, which multiplies their hazard by e^(−β4) from that month onward — a real, persistent reduction in churn risk. Support Responsiveness scales down how fast unresolved support tickets accumulate for every customer, which lowers the β2·support_tickets_i(t) term in every hazard calculation. Because both levers feed directly into the same Cox-style hazard equation used to draw churn events, moving a slider recomputes the entire cohort's event history against the same underlying random draws and immediately reshapes the Kaplan-Meier curve — it is not a cosmetic overlay.
Why does the simulation replay the same random numbers when I move a slider?
Each customer's baseline usage-decline trajectory, support-ticket noise and monthly churn-draw sequence are generated once per cohort and stored. When a lever changes, the simulation reruns the exact same monthly loop with the new hazard coefficients against those same stored random numbers, rather than resampling fresh randomness. That isolates the causal effect of the lever: any difference you see in the survival curve after moving a slider comes from the change in hazard, not from a new roll of the dice, which is exactly the counterfactual comparison a real retention team wants when asking "what would happen if we discounted more aggressively?"
How closely does this match real production churn modeling?
Production churn systems typically fit a Cox proportional hazards model or a discrete-time hazard model (logistic regression per period) on real historical usage, billing and support data with dozens of engineered features, then validate the fitted hazard ratios and Kaplan-Meier curves against held-out cohorts. This simulation implements the same mathematical objects — a genuine per-customer hazard function, real Bernoulli churn draws, and a real Kaplan-Meier estimator over the resulting event history — but the feature weights are hand-tuned rather than fit by maximum partial likelihood on real data, so it should be read as a faithful mechanism demonstration of survival-based churn modeling rather than a calibrated production model.
A Cox-style per-customer hazard combines usage decline, support-ticket load, tenure and discount status with a shared Weibull baseline; real monthly Bernoulli churn draws build an event history, and a genuine Kaplan-Meier estimator turns that history into the cohort survival curve you can reshape with the retention levers.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install