← Back to the full chapter
Lesson

6. When to use survival analysis

Separate the risk of leaving from the effect of trying to retain a customer.

5 min readApplied extensionUpdated
Read source ↗

If you observe a subscriber for ten days without churn, you know only that they lasted those ten days, not their 30-day outcome. Survival analysis stores an event indicator and the observed time until churn or right censoring (observation ended before churn was seen). It can use partial follow-up without inventing a negative classification label. scikit-survival introduction.

Choose the time origin explicitly: acquisition for a lifecycle model, or as_of for a landmark model predicting remaining lifetime among customers still active then. If you model lifetime from acquisition but the data start later, handle delayed entry instead of pretending you saw customers from signup. Historical tenure alone is not an event time. Censor at the last date the event feed is known complete, not the date a CSV was downloaded.

Both estimation and evaluation need defensible censoring assumptions. Record why observation ended and whether censoring depends on measured customer history or unobserved risk. A planned study end differs from losing visibility after a migration. A more flexible survival model cannot recover unobserved outcomes by itself. When simple independent censoring is implausible, document conditional modelling or sensitivity assumptions.

Start with Kaplan-Meier for a population baseline and penalised Cox for a compact conditional model. Cox proportional hazards assumes proportional relative hazards for the covariates in its specified form, so check that assumption and model fit. Nonlinear terms or stratification may help, but a coefficient does not identify a causal reason to churn. lifelines survival regression.

Compare a random survival forest when interactions or changing relative risk over time matter. It estimates survival functions without imposing Cox proportional hazards. A forest's generic predict output is a risk score, not a 30-day probability. Get a survival function and compute 1 - S(30) for the chosen origin and defined all-cause event. For a particular cause with competing events, use the cumulative-incidence approach below. Random survival forest guide.

Gradient boosting with a Cox loss can learn nonlinear feature effects while keeping the proportional-hazards structure. It does not automatically fix every violation of that assumption. Other survival losses, including accelerated-failure-time approaches, have different assumptions. Name the fitted loss, not just "XGBoost survival" or "survival boosting". Survival boosting guide.

For changing usage, a practical first approach is to rebuild features at each scoring landmark and predict the next horizon. More advanced models use start-stop intervals or a discrete-time hazard with covariates known at the start of each interval. Keep the customer's later usage trajectory out of an earlier prediction. Time-varying Cox needs interval data. Predicting ahead also needs an explicit assumption about future covariates, because the library cannot know them. Keep repeated landmarks or intervals together for uncertainty calculations. lifelines time-varying survival guide.

Evaluate survival on future cohorts using IPCW concordance for ranking, time-dependent AUC at the decision horizons and Brier score / integrated Brier score (IBS) for predicted survival probabilities. Harrell's concordance can be optimistic with heavy censoring. IPCW means inverse probability of censoring weighting. It relies on a suitable censoring mechanism and enough follow-up. Marginal censoring estimates need independence assumptions. If censoring depends on customer characteristics, consider conditional modelling and sensitivity checks. Choose supported time ranges in advance, keep estimated censoring survival above zero, and estimate censoring from the designated training or reference sample. IBS needs survival probabilities, not an arbitrary risk score. Survival evaluation guide, time-dependent AUC assumptions, IBS documentation.

Competing events change the probability target. If closure or a known service migration rules out voluntary churn within the episode, keep separate event codes. Start with an Aalen–Johansen cumulative-incidence baseline for the probability of voluntary churn before competing events. With covariates, cause-specific hazard models for all causes can be combined into that probability. A single cause-specific Cox survival complement is not enough. Censoring competing events and reporting 1 - Kaplan–Meier instead gives a net-risk quantity, not the observed probability of voluntary churn before another cause. Use cause-compatible evaluation and calibration. A disappearance with unknown cause is loss to follow-up and needs censoring assumptions. It is not automatically a known competing event. Competing-risk guide, Aalen–Johansen implementation.

Check calibration at the operational horizon. For a fitted lifelines regression model, survival_probability_calibration gives a censor-aware, out-of-sample calibration curve at t0, with ICI and E50 summaries. It is a diagnostic, not a drop-in calibrator for every survival library or a competing-risk evaluator. Avoid turning unfinished follow-up into negative labels or simply dropping censored customers. If you fit a recalibration mapping, use a separate cohort and keep survival probabilities coherent across horizons before testing on the final future cohort.

Survival handles observation limits. It does not turn observational customer histories into retention experiments.

Optional research: a survival foundation-model challenger

SurvPFN, revised June 2026 and accepted to the ICML 2026 Foundation Models for Structured Data workshop, uses a NanoTabPFN-style architecture pretrained on synthetic censored-survival tasks. Its evaluation uses cross-validation on 22 datasets with at most 1,000 rows and 10 features. Its synthetic prior includes Weibull event times and noninformative censoring, so it does not settle a winner for large longitudinal CRM tables. The authors report Cox as best in their evaluation, with no statistically significant pairwise model differences.

For a small censored dataset, you can compare it with Cox, survival forests and boosting on the same landmarks and future cohorts. Report horizon calibration, IPCW metrics, IBS, uncertainty, runtime and licence constraints. Test censoring and feature patterns unlike its prior. This is optional depth after the 25-hour prototype. Survival prediction still does not identify retention treatment effects.

Something unclear or out of date? Suggest a correction ↗

Find your next idea

Loading local search…

Search is built from this edition. No account needed.