Related Experiment Video
Updated: Aug 30, 2026

Establishing a Competing Risk Regression Nomogram Model for Survival Data
Published on: October 23, 2020
unsurv: clustering individualized survival curves
1AI and Data Science Service, Mohammed VI Center for Research and Innovation (CM6RI), Rabat, Morocco.
Motivation:
Biomedical phenotyping workflows often cluster high-dimensional molecular or clinical covariates and then test survival differences post hoc. This can miss structure that is expressed primarily through the timing of risk, because two patients may have similar scalar risk at one horizon but different predicted survival trajectories. Many survival learners can output patient-specific curves on a common time scale. Clustering these curves gives a survival-native post-prediction representation for exploratory phenotyping. Existing work on survival-curve clustering mainly targets predefined Kaplan-Meier curves or general functional data, whereas a practical tool for individual-level predicted survival curves remains less developed.
Results:
We introduce unsurv, an R package that clusters individualized survival curves on a common time grid using validity-preserving preprocessing, time-weighted integral distances, and partitioning around medoids (PAM). The output includes observed medoid prototype curves, a nearest-medoid rule for assigning new patients, model-selection summaries, resampling-based stability using the Adjusted Rand Index (ARI), and a new unsurv_compare() function for comparing partitions against baselines. The package is model-agnostic and can be paired with any survival learner that returns . We illustrate the workflow on a synthetic example and on the METABRIC breast cancer cohort using survdnn-predicted survival curves, including baseline comparisons and an out-of-sample validation check showing that the curve-based cluster ordering generalizes to held-out patients.
Availability And Implementation:
The unsurv package is available on CRAN and its full source code and documentation are provided at https://github.com/ielbadisy/unsurv under the MIT License.
Related Concept Videos
Survival Curves
The Kaplan-Meier estimator is the most common method for constructing survival curves. This...
Comparing the Survival Analysis of Two or More Groups
Cancer Survival Analysis
Survival Tree
Building a Survival Tree
Constructing a survival tree begins...
Assumptions of Survival Analysis
Kaplan-Meier Approach

