comprisk:一个兼容scikit-learn的竞争风险生存分析Python工具包 comprisk: A scikit-learn-compatible Python toolkit for competing-risks survival analysis 预印本
原文摘要
查看英文原文摘要
Medical time-to-event data are frequently subject to competing risks, where the occurrence of one terminal event precludes the others and standard survival methods that treat competing events as censoring yield biased absolute-risk estimates. Valid analysis instead targets the cause-specific cumulative incidence function (CIF). This methodology has been available to applied researchers almost exclusively through R packages, forcing Python-based machine-learning workflows into a Python-to-R round trip. We present comprisk, a scikit-learn-compatible Python toolkit that puts the canonical competing-risks methods behind one API: a scalable competing-risks random survival forest, Fine-Gray subdistribution-hazard regression and a penalized variant, cause-specific Cox regression, the Aalen-Johansen CIF estimator, and Gray's K-sample test, together with competing-risks-aware model evaluation. Every estimator is validated numerically against its R reference implementation. The forest uses a histogram-based, numba-compiled split kernel that fits 10-22x faster than randomForestSRC at comparable discrimination on real clinical cohorts and scales to n = 10^6 on a consumer CPU. comprisk is distributed on PyPI and lets applied researchers run correct, scalable competing-risks analysis without leaving the Python scientific stack.
📚 参考文献 (23 条)
查看23 条参考文献
- [1] Odd O. Aalen and Søren Johansen. An empirical transition matrix for non-homogeneous Markov chains based on censored observations. Scandinavian Journal of Statistics, 5(3):141–150, 1978.
- [2] Peter C. Austin, Douglas S. Lee, and Jason P. Fine. Introduction to the analysis of survival data in the presence of competing risks. Circulation, 133(6):601–609, 2016. doi: 10.1161/ CIRCULATIONAHA.115.017719.
- [3] Leo Breiman. Random forests. Machine Learning, 45(1):5–32, 2001. doi: 10.1023/A: 1010933404324.
- [4] Cameron Davidson-Pilon. lifelines: survival analysis in Python. Journal of Open Source Software, 4(40):1317, 2019. doi: 10.21105/joss.01317.
- [5] Jason P. Fine and Robert J. Gray. A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association, 94(446):496–509, 1999. doi: 10.1080/01621459.1999.10474144.
- [6] Zhixuan Fu. crrp: Penalized Variable Selection in Competing Risks Regression, 2015. URL https://CRAN.R-project.org/package=crrp. R package version 1.0.
- [7] Thomas A. Gerds, Johan S. Ohlendorff, Paul Blanche, et al. riskRegression: Risk Regression Models and Prediction Scores for Survival Analysis with Competing Risks, 2026. URL https: //CRAN.R-project.org/package=riskRegression. R package version 2026.03.11.
- [8] Robert J. Gray. A class of K-sample tests for comparing the cumulative incidence of a competing risk. The Annals of Statistics, 16(3):1141–1154, 1988. doi: 10.1214/aos/1176350951.
- [9] Robert J. Gray. cmprsk: Subdistribution Analysis of Competing Risks, 2024. URL https: //CRAN.R-project.org/package=cmprsk. R package version 2.2-12.
- [10] Olivier Grisel, Vincent Maladière, Julie Alberge, Judith Abecassis, and Gaël Varoquaux. hazardous: Predictive Competing Risks and Survival Analysis, 2026. URL https://github. com/soda-inria/hazardous. Python package, version 0.2.0. 4
- [11] Hemant Ishwaran, Udaya B. Kogalur, Eugene H. Blackstone, and Michael S. Lauer. Random survival forests. The Annals of Applied Statistics, 2(3):841–860, 2008. doi: 10.1214/08-AOAS169.
- [12] Hemant Ishwaran, Thomas A. Gerds, Udaya B. Kogalur, Richard D. Moore, Stephen J. Gange, and Bryan M. Lau. Random survival forests for competing risks. Biostatistics, 15(4):757–773, 2014. doi: 10.1093/biostatistics/kxu010.
- [13] Mateusz Krzyziński, Mikołaj Spytek, Hubert Baniecki, and Przemysław Biecek. SurvSHAP(t): Time-dependent explanations of machine learning survival models. Knowledge-Based Systems, 262:110234, 2023. doi: 10.1016/j.knosys.2022.110234.
- [14] Håvard Kvamme, Ørnulf Borgan, and Ida Scheel. Time-to-event prediction with neural networks and Cox regression. Journal of Machine Learning Research, 20(129):1–30, 2019. URL http://jmlr.org/papers/v20/18-424.html.
- [15] Changhee Lee, William R. Zame, Jinsung Yoon, and Mihaela van der Schaar. DeepHit: A deep learning approach to survival analysis with competing risks. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
- [16] Scott M. Lundberg, Gabriel Erion, Hugh Chen, Alex DeGrave, Jordan M. Prutkin, Bala Nair, Ronit Katz, Jonathan Himmelfarb, Nisha Bansal, and Su-In Lee. From local explanations to global understanding with explainable AI for trees. Nature Machine Intelligence, 2(1):56–67, 2020. doi: 10.1038/s42256-019-0138-9.
- [17] Sebastian Pölsterl. scikit-survival: A library for time-to-event analysis built on top of scikit- learn. Journal of Machine Learning Research, 21(212):1–6, 2020. URL http://jmlr.org/ papers/v21/20-729.html.
- [18] Hein Putter, Marta Fiocco, and Ronald B. Geskus. Tutorial in biostatistics: competing risks and multi-state models. Statistics in Medicine, 26(11):2389–2430, 2007. doi: 10.1002/sim.2712.
- [19] Skipper Seabold and Josef Perktold. statsmodels: Econometric and statistical modeling with python. In Proceedings of the 9th Python in Science Conference, 2010.
- [20] Terry M. Therneau. A Package for Survival Analysis in R, 2024. URL https://CRAN. R-project.org/package=survival. R package version 3.8-3.
- [21] Hajime Uno, Tianxi Cai, Michael J. Pencina, Ralph B. D’Agostino, and L. J. Wei. On the C-statistics for evaluating overall adequacy of risk prediction procedures with censored survival data. Statistics in Medicine, 30(10):1105–1117, 2011. doi: 10.1002/sim.4154.
- [22] Marcel Wolbers, Michael T. Koller, Jacqueline C. M. Witteman, and Michael Schemper. Prognostic models with competing risks: methods and application to coronary risk prediction. Epidemiology, 20(4):555–561, 2009. doi: 10.1097/EDE.0b013e3181a39056.
- [23] Marcel Wolbers, Paul Blanche, Michael T. Koller, Jacqueline C. M. Witteman, and Thomas A. Gerds. Concordance for prognostic models with competing risks. Biostatistics, 15(3):526–539, 2014. doi: 10.1093/biostatistics/kxt059. 5