Survival Analysis & Time-to-Event Modeling
The boundary: LTV definitions, retention curves, cohort triangles and the simple churn-based lifetime formula live in product-analytics-metrics-and-ltv, which points here for predictive LTV; this subject supplies the time-to-event machinery. Experiment analysis (power, SRM, CUPED) is ab-testing, the classification metrics used at a fixed horizon (AUC, calibration) are in model-evaluation-metrics, aggregate time series are time-series-fundamentals, and an end-to-end churn pipeline is case-study-churn-model-end-to-end-mlops. Here the object is the time until an event for each individual, when some individuals have not had the event yet.
Interviews ask this as "how would you model customer churn when most users are still active?", "what is censoring and why can't you just drop those rows?", "explain a hazard ratio", "the Cox model assumes proportional hazards, how do you check it?" and "why not train a classifier for churn in 30 days?". The senior answer names the censoring mechanism and its assumption, estimates survival with Kaplan-Meier before modeling anything, checks proportional hazards, and evaluates on a time-aware split with censoring-aware metrics.
Everything executable below was run (Python 3.12, NumPy 2.5, SciPy 1.18, pandas 2.3, scikit-learn 1.9, lifelines 0.30, scikit-survival 0.28, statsmodels 0.15, fixed seeds) on simulated data with known hazards, or by hand on 10 users, and is marked "(verified)". Facts recalled from the literature without re-running are marked "(from memory)". I did not install or run XGBoost, DeepSurv or DeepHit; those are labelled as such. Simulated numbers show mechanics and relative sizes, not benchmarks of any real product.