Many health questions are not just "will an event happen?" but "when will it happen, and what else might happen first?" This guide introduces time-to-event prediction, censoring, hazards, survival curves, and competing risks for clinical machine learning.
The portal already covers classification metrics, calibration, train-validation-test splits, and leakage. Survival analysis fills the gap for outcomes such as time to death, time to hospital readmission, time to relapse, graft failure, or disease progression.
The clinical endpoint of interest, such as death, readmission, relapse, infection, or treatment failure.
The moment follow-up begins: diagnosis date, surgery date, enrollment date, discharge date, or first prescription.
A patient is censored when follow-up ends before the event is observed.
The instantaneous event rate among patients who have not yet had the event.
Choose a cohort scenario and watch how the event timing changes the survival curve. A step down means an observed event; a censoring mark means the patient left observation without the event being seen.
A competing risk is an event that prevents observing the primary event. For example, if the primary endpoint is cancer relapse, death from another cause prevents future relapse from being observed.
"What is the probability of remaining free of relapse over time?"
"What is the probability of relapse before death from another cause?"
"Which event should the care team plan for, and by what time horizon?"
Survival modeling is a family of methods. Choose the method based on the data size, interpretability needs, proportional hazards assumptions, and whether predictions must support bedside decisions.
| Method | Best for | Watch out for |
|---|---|---|
| Kaplan-Meier curve | Describing event-free survival for groups without many covariates. | It is descriptive; it does not adjust for many patient features. |
| Cox proportional hazards model | Interpretable covariate effects and hazard ratios. | The proportional hazards assumption may fail over long follow-up. |
| Random survival forest | Nonlinear patterns and interactions without specifying a parametric form. | Interpretation and calibration need extra care. |
| Deep survival model | Large, high-dimensional data such as imaging, waveform, omics, or longitudinal EHR features. | Requires strong validation, transparency planning, and careful leakage control. |
| Competing-risk model | Endpoints where different event types block each other, such as relapse versus non-cancer death. | Report event-specific probabilities, not just one overall risk score. |
State the event, time origin, maximum follow-up, and whether competing events exist.
Keep repeated patients together and avoid training on future information when deployment is temporal.
Preprocessing, feature selection, imputation, and tuning must stay inside the training folds.
Use discrimination, calibration, and decision usefulness at prespecified time horizons.
A patient is event-free at the last clinic visit, then moves away. What is this?
If death prevents observing relapse, what should you consider?
Which quantity is most useful for a decision such as screening every 6 months?
Survival data still need clean splits, grouped patients, and time-aware validation to avoid leakage.
Time-to-event models should be calibrated at clinically meaningful time horizons before use.
Event rates, treatment pathways, and censoring mechanisms can drift over time, so survival models need ongoing checks.