# 随机生存森林

随机生存森林（random survival forest，RSF）是一种集成机器学习方法，它通过生长许多随机化生存树并对这些树的估计取平均，从右删失数据中预测事件发生时间结局。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup> 它将[利奥·布雷曼](https://www.edgepedia.org/zh/leo-breiman)（Leo Breiman）的随机森林算法<sup>[2](https://doi.org/10.1023/a:1010933404324)</sup>改造用于生存分析：与把生存问题改写成分类或回归问题的森林不同，树生长的每一步都同时使用观测到的事件时间和删失指示变量。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup> 它完全非参数，无需假设参数关系（线性或非线性）即可识别生存风险因素，并提供几乎无偏的袋外预测误差。<sup>[3](https://luminwin2.github.io/pdfs/docs/Random_Survival_Forests.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 分裂规则 | 在 randomForestSRC 中，默认使用对数秩检验统计量；也可选用对数秩评分<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> |
| 默认调参（randomForestSRC） | 终端节点大小为 15，每个变量 nsplit 为 10 个随机分裂点，生存分析的 \( \mathrm{mtry} = \sqrt{p} \)<sup>[5](https://search.r-project.org/CRAN/refmans/randomForestSRC/html/rfsrc.html)</sup> |
| 袋外比例 | 一个自助样本平均遗漏 36.8% 的数据<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> |
| 误差指标 | \( 1 - C \)，使用哈雷尔（Harrell）一致性指数；布里尔（Brier）分数，使用删失逆概率权重<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> |
| 竞争风险 | 默认分裂为基于格雷（Gray）检验的加权对数秩（`logrankCR`）<sup>[6](https://www.randomforestsrc.org/articles/competing)</sup> |
| 基准准确度 | 在 GBSG-2 乳腺癌数据（686 名女性，8 个预后因素）上，1000 棵树的森林达到约 0.68 的测试一致性，与原论文相符<sup>[7](https://scikit-survival.readthedocs.io/en/v0.26.0/user%5Fguide/random-survival-forest.html)</sup> |

## 工作原理

生存数据由每个受试者的事件时间和删失指示变量组成；对于删失受试者，只能确定其截至最后一次观测时未发生事件。RSF 用新的生存分裂规则取代平方误差分裂准则，这些规则在每个节点上通过比较两组的生存分布来计算。原始实现提供了四种规则：最大化[对数秩检验](https://www.edgepedia.org/zh/log-rank-test)统计量、事件守恒、标准化对数秩评分统计量和随机对数秩分裂。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup> 此后，对数秩规则或许已成为标准准则。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC11661562/)</sup>

每个终端节点必须至少包含一个唯一死亡事件。在一个节点内，累积风险用内尔森–阿伦（Nelson–Aalen）估计量 \( H_{h}(t)=\sum_{t_{j,h}\le t} d_{j,h}/Y_{j,h} \) 估计，生存函数用卡普兰–迈耶（Kaplan–Meier）估计量估计；集成估计是所有树上各树曲线的平均值。<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> 对单个受试者而言，一致性计算中使用的预测值是死亡风险值，即事件时间上的累积风险之和，并校准到期望事件数。<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> 袋外（OOB）集成由每个自助样本所排除的约 36.8% 数据构建，可在训练样本上提供几乎无偏的误差估计。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup>

## 实施方法

实践者抽取 B 个自助样本，在每个样本上生长一棵生存树，然后进行汇总。在 randomForestSRC 中，默认值为终端节点大小 15、每次分裂的候选变量数 \( \mathrm{mtry} = \sqrt{p} \)，以及每个变量随机选取 \( \mathrm{nsplit} = 10 \) 个分裂点；\( \mathrm{nsplit} = 0 \) 会确定性地搜索所有取值。<sup>[5](https://search.r-project.org/CRAN/refmans/randomForestSRC/html/rfsrc.html)</sup> 随机化分裂可减少计算量，并缓解已知的树偏向于具有许多分裂点的变量的问题；将 \( \mathrm{nsplit} \) 设为 1 对应于[极端随机树](https://www.edgepedia.org/zh/extremely-randomized-trees)。<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup><sup> • </sup><sup>[9](https://doi.org/10.1007/s10994-006-6226-1)</sup>

预测误差报告为 \( 1 - C \)，其中 \( C \) 是哈雷尔一致性指数，<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> 一种不依赖于固定评价时间的秩度量。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup> 时间依赖准确度使用以删失逆概率权重估计的布里尔分数，<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> 并通过积分布里尔分数 \( \mathrm{IBS}(\tau)=\frac{1}{\tau}\int_{0}^{\tau} \mathrm{BS}(t)\,dt \) 在 0 到 τ 上汇总。<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> 变量重要性有两种形式。置换 VIMP 随机置换某变量的 OOB 值，将其沿树向下传递，并报告 OOB 误差的增加量；较大的正值表明具有预测能力，而零或负值则识别噪声变量。<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup> 最小深度是一种无量纲的顺序统计量，衡量一个变量在树中分裂得有多早，是为高维问题中的变量选择而开发的。<sup>[10](https://onlinelibrary.wiley.com/doi/10.1002/sam.10103)</sup>

## 起源

RSF 由赫曼特·伊什瓦兰（Hemant Ishwaran）及其同事在《随机生存森林》（"Random survival forests"）一文中提出，发表于《应用统计学年鉴》（The Annals of Applied Statistics），2008 年。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup> 该方法建立在布雷曼的随机森林<sup>[2](https://doi.org/10.1023/a:1010933404324)</sup>以及更早的生存树和集成工作之上，这些工作曾将树生长改造用于删失数据；2008 年的论文还遵循布雷曼 2003 年的主张，即生长森林的所有方面都要考虑结局。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup> 对数秩评分分裂规则借鉴了托尔斯滕·霍索恩（Torsten Hothorn）与贝特霍尔德·劳森（Berthold Lausen）关于最大选择秩统计量的工作，发表于《计算统计与数据分析》（Computational Statistics & Data Analysis），2003 年。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup> 同一团队的后续研究表明，该森林是一致相合的，并在有限样本中具有一致逼近性质，而生存树缺乏这一性质。<sup>[11](https://doi.org/10.1198/jasa.2009.tm08622)</sup> 最初的 R 实现出现在 randomSurvivalForest 包中，<sup>[10](https://onlinelibrary.wiley.com/doi/10.1002/sam.10103)</sup> 如今该方法记录于 randomForestSRC 中。<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup>

## 变体

**竞争风险。** 赫曼特·伊什瓦兰及其同事在《[生物统计学](https://www.edgepedia.org/zh/biostatistics)》（Biostatistics）2014 年的一篇文章中将 RSF 扩展到竞争风险。<sup>[12](https://doi.org/10.1093/biostatistics/kxu010)</sup> 分裂使用广义对数秩检验或格雷检验（randomForestSRC 中的默认 `logrankCR`），事件特异性累积发生率函数用阿伦–约翰森（Aalen–Johansen）估计量估计，其与原因别风险的关系为 \( F_{j}(t\mid X)=\int_{0}^{t} S(s-\mid X)\,\alpha_{j}(s\mid X)\,ds \)。<sup>[6](https://www.randomforestsrc.org/articles/competing)</sup>

**替代分裂规则。** C 指数分裂由马蒂亚斯·施密德（Matthias Schmid）、马文·N·赖特（Marvin N. Wright）和安德烈亚斯·齐格勒（Andreas Ziegler）于 2016 年提出用于临床风险预测，在删失率较高时往往优于对数秩分裂，而在噪声较多的情形下对数秩分裂更可取；作者建议较小的临床研究采用 C 指数分裂，大规模组学数据采用对数秩分裂。<sup>[13](https://doi.org/10.1016/j.eswa.2016.07.018)</sup> 还存在用于交叉风险的 L1 规则和布里尔分数分裂；在 2024 年的一项基准测试中，L1 规则在测试的任何数据生成水平上都未优于对数秩 RSF。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC11661562/)</sup>

**其他森林。** 条件推断森林在分裂前通过置换检验选择变量，以更高的计算成本减少分裂点偏差。<sup>[14](https://pmc.ncbi.nlm.nih.gov/articles/PMC8465777/)</sup> 斜向随机生存森林由拜伦·C·耶格尔（Byron C. Jaeger）及其同事在《应用统计学年鉴》2019 年的一篇文章中提出，它在每次分裂时拟合带有弹性网惩罚的正则化 Cox 模型，并进行无放回抽样。<sup>[15](https://doi.org/10.1214/19-aoas1261)</sup> RecForest 由朱丽叶·穆里斯（Juliette Murris）及其同事在《BMC 医学研究方法学》（BMC Medical Research Methodology）2025 年的一篇文章中提出，将 RSF 扩展到有或无终端事件的复发事件数据，使用边际戈什–林（Ghosh–Lin）模型中的伪评分检验或沃尔德检验作为分裂规则。<sup>[16](https://doi.org/10.1186/s12874-025-02678-z)</sup>

## 应用

已发表的比较并未指向同一方向。在 2008 年论文的 11 个真实和模拟数据集中，采用对数秩或对数秩评分分裂的 RSF 在几乎所有例子中预测误差最低，并且在加入 10–100 个噪声变量时保持稳定，而 Cox 回归则逐渐变差。<sup>[1](https://doi.org/10.1214/08-aoas169)</sup> 一项 2022 年覆盖 180 个情景的模拟研究发现，当事件数为 70 或更少时，Cox-PH 至少不劣于 RSF；而在 50% 删失或 75% 删失且 \( n = 5000 \) 的情况下，随着复杂度增加，RSF 在 AUC 上比 Cox-PH 高 1.1–3.2%；向 Cox-PH 加入样条后，其 AUC 和 IBS 平均分别提高 7.8% 和 8.4%。<sup>[17](https://epidetect.gr/wp-content/uploads/2023/12/7_Biometrical-J-2022-Baralou-Individua-l-risk-prediction-Comparing-random-forest-.pdf)</sup> 在 2024 年对森林方法在 10%、25% 和 70% 删失下的基准测试中，性能取决于删失水平和数据生成机制，而非任何单一优胜者。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC11661562/)</sup> 一项 2025 年基于临床试验参考数据集的中立比较发现，RSF 按 C 指数通常更准确，但在无治疗–协变量交互的非比例风险设定下，Cox 模型在 60% 删失时表现最佳，且 RSF 的校准在许多情况下比 Cox 差；当存在治疗–协变量交互时，RSF 表现更好。<sup>[18](https://arxiv.org/html/2502.03119v2)</sup>

## 局限与替代方法

RSF 继承了随机森林偏向具有许多可能分裂点的协变量的选择偏差，这也可能使变量重要性度量产生偏差；一项 2017 年使用 22 个模拟数据集和两个真实数据集的模拟研究发现，恰恰当协变量具有许多分裂点时，条件推断森林在自助交叉验证积分布里尔分数上优于 RSF。<sup>[14](https://pmc.ncbi.nlm.nih.gov/articles/PMC8465777/)</sup><sup> • </sup><sup>[19](https://link.springer.com/article/10.1186/s12874-017-0383-8)</sup> 补救方法包括通过 \( \mathrm{nsplit} \) 进行随机化分裂<sup>[4](https://www.randomforestsrc.org/articles/survival.html)</sup>以及条件推断森林。<sup>[14](https://pmc.ncbi.nlm.nih.gov/articles/PMC8465777/)</sup> 判别性能受较高删失的影响比 Cox 模型更大，<sup>[18](https://arxiv.org/html/2502.03119v2)</sup> 且 RSF 算法训练所需的事件数高于 Cox-PH。<sup>[17](https://epidetect.gr/wp-content/uploads/2023/12/7_Biometrical-J-2022-Baralou-Individua-l-risk-prediction-Comparing-random-forest-.pdf)</sup> 计算比 Cox 回归慢，并且对于对数秩评分、布里尔分数和 C 指数规则，计算量会随样本量和协变量数量显著增长。<sup>[18](https://arxiv.org/html/2502.03119v2)</sup>

## References

1. [Hemant Ishwaran and colleagues (2008). Random survival forests. The Annals of Applied Statistics.](https://doi.org/10.1214/08-aoas169)
2. [Leo Breiman (2001). Random Forests. Machine Learning.](https://doi.org/10.1023/a:1010933404324)
3. [Random Survival Forests (Ishwaran and Lu, Wiley StatsRef review)](https://luminwin2.github.io/pdfs/docs/Random_Survival_Forests.pdf)
4. [Random Survival Forests • randomForestSRC documentation](https://www.randomforestsrc.org/articles/survival.html)
5. [rfsrc: Fast Unified Random Forests (CRAN reference manual)](https://search.r-project.org/CRAN/refmans/randomForestSRC/html/rfsrc.html)
6. [Competing Risks • randomForestSRC documentation](https://www.randomforestsrc.org/articles/competing)
7. [Using Random Survival Forests (scikit-survival v0.26.0 user guide)](https://scikit-survival.readthedocs.io/en/v0.26.0/user%5Fguide/random-survival-forest.html)
8. [Random forests for survival data: which methods work best and under what conditions? (2024)](https://pmc.ncbi.nlm.nih.gov/articles/PMC11661562/)
9. [Pierre Geurts, Damien Ernst, Louis Wehenkel (2006). Extremely randomized trees. Machine Learning.](https://doi.org/10.1007/s10994-006-6226-1)
10. [Random survival forests for high-dimensional data (Statistical Analysis and Data Mining, 2011)](https://onlinelibrary.wiley.com/doi/10.1002/sam.10103)
11. [Hemant Ishwaran and colleagues (2010). High-Dimensional Variable Selection for Survival Data. Journal of the American Statistical Association.](https://doi.org/10.1198/jasa.2009.tm08622)
12. [Hemant Ishwaran and colleagues (2014). Random survival forests for competing risks. Biostatistics.](https://doi.org/10.1093/biostatistics/kxu010)
13. [Matthias Schmid, Marvin N. Wright, Andreas Ziegler (2016). On the use of Harrell’s C for clinical risk prediction via random survival forests. Expert Systems with Applications.](https://doi.org/10.1016/j.eswa.2016.07.018)
14. [A comparative study of forest methods for time-to-event data: variable selection and predictive performance](https://pmc.ncbi.nlm.nih.gov/articles/PMC8465777/)
15. [Byron C. Jaeger and colleagues (2019). Oblique random survival forests. The Annals of Applied Statistics.](https://doi.org/10.1214/19-aoas1261)
16. [Juliette Murris and colleagues (2025). Random survival forests for the analysis of recurrent events for right-censored data, with or without a terminal event. BMC Medical Research Methodology.](https://doi.org/10.1186/s12874-025-02678-z)
17. [Individual risk prediction: Comparing random forests with Cox proportional-hazards model by a simulation study (Baralou et al., Biometrical Journal 2022)](https://epidetect.gr/wp-content/uploads/2023/12/7_Biometrical-J-2022-Baralou-Individua-l-risk-prediction-Comparing-random-forest-.pdf)
18. [Comparison of the Cox proportional hazards model and Random Survival Forest algorithm for predicting patient-specific survival probabilities in clinical trial data (2025)](https://arxiv.org/html/2502.03119v2)
19. [A comparison of the conditional inference survival forest model to random survival forests based on a simulation study as well as on two applications with time-to-event data (BMC Medical Research Methodology, 2017)](https://link.springer.com/article/10.1186/s12874-017-0383-8)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 21, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods › Ensemble, boosting, and transfer methods › Bagging, random forests, and variance-reduction ensembles

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/random-survival-forest

English original: https://www.edgepedia.org/random-survival-forest
