Build and validate individualized time-to-event risk models on clinical and omics data with penalized Cox, random survival forests, gradient-boosted and deep survival models. The discipline this skill enforces is that the C-index alone is the cardinal evaluation sin: it is censoring-dependent, blind to calibration, and insensitive, so a credible model is judged by Uno's C plus time-dependent AUC, integrated Brier versus a Kaplan-Meier baseline, and calibration. For Kaplan-Meier, log-rank, and classical Cox hazard-ratio inference, use clinical-biostatistics/survival-analysis.
pip install scikit-survival lifelines pandas
# pip install pycox torch # only for deep survival models (DeepSurv, DeepHit)
Conceptual prerequisites: a time and a boolean event column; awareness of competing events (which require the cumulative incidence function, not 1-KM) and of immortal time bias (no group defined by a post-baseline event); and feature selection placed inside the resampling loop.
Tell your AI agent what you want to do: - "Fit a penalized Cox prognostic signature and validate it properly" - "Compare a random survival forest against an elastic-net Cox baseline" - "Evaluate my survival model with Uno's C, time-dependent AUC, and integrated Brier, not just the C-index" - "I have competing risks -- model the cumulative incidence correctly"
"Build an elastic-net Cox prognostic signature from my expression matrix and clinical covariates, with feature selection inside nested cross-validation."
"Fit a random survival forest and a penalized Cox model and tell me whether the forest actually beats the linear baseline on held-out data."
"Evaluate my survival model with Uno's IPCW C at a 5-year horizon, time-dependent AUC over the follow-up, integrated Brier versus a Kaplan-Meier baseline, and a calibration curve."
"My model has a high C-index. Check whether its predicted absolute risks are actually calibrated."
"Patients also die of other causes. Model the cumulative incidence with Fine-Gray and report cause-specific hazards too, and do not use 1 minus Kaplan-Meier."
"My exposure is defined by something that happens after baseline. Check for immortal time bias and fix it with landmarking."