Survival modeling using deep learning, machine learning and statistical methods: A comparative analysis for predicting mortality after hospital admission
Survival analysis is essential for studying time-to-event outcomes and providing a dynamic understanding of the probability of an event occurring over time. Various survival analysis techniques, from traditional statistical models to state-of-the-art machine learning algorithms, support healthcare intervention and policy decisions. However, there remains ongoing discussion about their comparative performance. This study conducted benchmark comparisons of statistical modelling (the accelerated failure time model [AFT]1, Cox proportional hazards model [CoxPH]2, Stepwise CoxPH3, Elastic net penalized CoxPH [CoxEN]4), ensemble machine learning (randon survival forest [RSF]5, Gradient boosting [GBM]6), interpretable machine learning (AutoScore-Survival7), and deep learning (DeepSurv8, CoxTime9, and DeepHit10).
- R packages: 'dplyr', 'ggplot2', 'survival', 'rms', 'AutoScore', 'randomForestSRC', 'pROC', 'survAUC', 'tsutils'.
- Python: version 3.9 (Windows)
To install the required Python packages, run:
pip install -r requirements.txt.
- Read data from CSV or Excel files.
- For this demo, use the generated survival data samples in the directory
data/sample_data_survivalordata/sample_data_survival_small. sample_data_survivalhas 20000 simulated samples with survival outcomes, which has the same data distribution as the MIMIC-III ICU database. The corresponding training, validation, test data set are generated and saved in thedata/train_set,data/val_setanddata/test_set.sample_data_survival_smallhas 1000 simulated samples with survival outcomes, which are also from MIMIC-III ICU database. The corresponding training, validation, test data set are generated and saved in thedata/train_set_small,data/val_set_smallanddata/test_set_small.
- The application of different statistical and machine learning frameworks is available in
script. In addition, the required software and packages are summarized as follows. - Description of various survival techniques
Models Software (Package) Traditional statistical model AFT R (rms) CoxPH R (survival) Stepwise CoxPH Python (lifelines) CoxEN Python (scikit-surv) Ensemble machine learning RSF R (randomForestRC) GBM Python (scikit-surv) Interpretability machine learning AutoScore-Survival R (AutoScore) Feedforward deep neural network DeepSurv Python (Pycox) CoxTime Python (Pycox) DeepHit Python (Pycox)
- Our study incorporates survival metrics such as the concordance index (C-index)11 and integrated Brier score (IBS)12, which are essential for measuring the model's goodness-of-fit, providing a comprehensive assessment of discrimination, and assisting in the evaluation of calibration and stability of the models.
- Select the required model in
scriptto run, with the performance output files stored in the folderresultsand importance plot stored in the folderfigures. For instance, runscripts/Python/DeepSurv.pythe performance results are saved inresults/result_deepsurv.csvand the importance generated by SHAP analysis is saved infigures/vimp_deepsurv.png. - The importance of the neural network using SHAP analysis in this demo is represented as follows:

We further conducted the Multiple Comparisons with the Best (MCB) test for C-index and IBS measures to assess the statistical significance of different models' performance.
Run script scripts/R/MCB/mcb_plot.R to draw MCB plots for C-index and IBS, with results stored in figures. The MCB plot in this demo is represented as follows:

Z. Wang, et al. "Survival modeling using deep learning, machine learning and statistical methods: A comparative analysis for predicting mortality after hospital admission". arXiv preprint arXiv:2403.06999 (2024)
- Nan Liu, E-mail: liu.nan@duke-nus.edu.sg
- Ziwen Wang, E-mail: ziwen.wang@duke-nus.edu.sg
- Tanujit Chakraborty, E-mail: tanujitisi@gmail.com
Footnotes
-
Buckley J, James I: Linear regression with censored data. Biometrika 1979, 66(3):429-436. ↩
-
Cox DR: Regression models and life‐tables. Journal of the Royal Statistical Society: Series B (Methodological) 1972, 34(2):187-202. ↩
-
Liang H, Zou G: Improved AIC selection strategy for survival analysis. Computational statistics & data analysis 2008, 52(5):2538-2548. ↩
-
Zou H, Hastie T: Regularization and variable selection via the elastic net. Journal of the royal statistical society: series B (statistical methodology) 2005, 67(2):301-320. ↩
-
Ishwaran H, Kogalur UB, Blackstone EH, Lauer MS: Random survival forests. The annals of applied statistics 2008, 2(3):841-860. ↩
-
Hothorn T, Bühlmann P, Dudoit S, Molinaro A, Van Der Laan MJ: Survival ensembles. Biostatistics 2006, 7(3):355-373. ↩
-
Xie F, Ning Y, Yuan H, Goldstein BA, Ong MEH, Liu N, Chakraborty B: AutoScore-Survival: Developing interpretable machine learning-based time-to-event scores with right-censored survival data. Journal of Biomedical Informatics 2022, 125:103959. ↩
-
Katzman JL, Shaham U, Cloninger A, Bates J, Jiang T, Kluger Y: DeepSurv: personalized treatment recommender system using a Cox proportional hazards deep neural network. BMC medical research methodology 2018, 18(1):1-12. ↩
-
Kvamme H, Borgan Ø, Scheel I: Time-to-event prediction with neural networks and Cox regression. arXiv preprint arXiv:190700825 2019. ↩
-
Lee C, Zame W, Yoon J, Van Der Schaar M: Deephit: A deep learning approach to survival analysis with competing risks. In: Proceedings of the AAAI conference on artificial intelligence: 2018; 2018. ↩
-
Harrell FE, Califf RM, Pryor DB, Lee KL, Rosati RA: Evaluating the yield of medical tests. Jama 1982, 247(18):2543-2546. ↩
-
Harrell Jr FE, Lee KL, Mark DB: Multivariable prognostic models: issues in developing models, evaluating assumptions and adequacy, and measuring and reducing errors. Statistics in medicine 1996, 15(4):361-387. ↩