# 梯度提升决策树

[梯度提升](https://www.edgepedia.org/zh/gradient-boosting)决策树（GBDT）是一种集成机器学习方法，它构建一系列小型回归树，每棵树都拟合以纠正之前树的误差，并将它们的输出求和以做出预测。它专为表格数据上的监督预测而设计，为回归产生数值，或为分类产生类别概率，与之类似的基于树的方法在中等规模的表格数据集上仍保持最先进水平。

| 关键事实 | 详情 |
|---|---|
| 模型形式 | 回归树的加性展开，逐阶段更新为 \( F_{m}(x) = F_{m-1}(x) + \nu \cdot \rho_{m} \cdot h(x; a_{m}) \)，其中收缩系数 \( 0 < \nu \le 1 \) <sup>[1](https://faculty.cc.gatech.edu/~zha/CS8803WST/boosting.pdf)</sup> |
| 输出 | 对各棵树的输出求和得到的分数；对于分类，该分数通过 sigmoid 或 softmax 转换为概率 <sup>[2](https://www.cse.chalmers.se/~richajo/dit866/files/gb_explainer.pdf)</sup> |
| 核心超参数 | 学习率 \( \nu \)（典型值约 0.1）、树的数量 \( M \)、树的大小（深度或终端节点数 \( J \)）、子采样比例 <sup>[1](https://faculty.cc.gatech.edu/~zha/CS8803WST/boosting.pdf)</sup><sup> • </sup><sup>[3](https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter7.html)</sup> |
| scikit-learn 默认值 | learning_rate = 0.1, n_estimators = 100, max_depth = 3, subsample = 1.0 <sup>[4](https://sklearn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html)</sup> |
| 表格精度 | 在 45 个数据集的基准测试中，基于树的模型在中等规模的表格数据集（约 10,000 个样本）上仍保持最先进水平 <sup>[5](https://papers.neurips.cc/paper_files/paper/2022/file/0378c7692da36807bdec87ab043cdadc-Paper-Datasets_and_Benchmarks.pdf)</sup> |
| 速度 | 在一项比较中，XGBoost 在训练和超参数优化方面比深度网络快一个数量级以上 <sup>[6](http://dl.acm.org/doi/10.1145/2939672.2939785)</sup> |
| 竞赛记录 | 2015 年发表的 29 个 Kaggle 获奖方案中有 17 个使用了 XGBoost，KDDCup 2015 中每支排名前十的队伍都使用了它 <sup>[6](http://dl.acm.org/doi/10.1145/2939672.2939785)</sup> |

## 工作原理

梯度提升将预测函数本身视为优化对象：函数逼近被视为函数空间中的数值优化，而非参数空间中的数值优化，从而将逐阶段加性展开与任意可微拟合准则下的最速下降最小化联系起来。<sup>[1](https://faculty.cc.gatech.edu/~zha/CS8803WST/boosting.pdf)</sup> 在每个阶段，算法计算损失相对于当前预测的负梯度，即伪残差，并对其拟合一个基学习器。<sup>[3](https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter7.html)</sup>

对于平方误差损失，伪响应恰好就是残差 \( \tilde{y}_{i} = y_{i} - F_{m-1}(x_{i}) \)，因此该过程简化为迭代拟合当前残差。<sup>[1](https://faculty.cc.gatech.edu/~zha/CS8803WST/boosting.pdf)</sup> 对于逻辑损失，伪残差为 \( y_{i} - p_{i,m-1} \)，初始化 \( f_{0} = \log(\bar{y}/(1-\bar{y})) \)。<sup>[3](https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter7.html)</sup> 无论原始任务是什么，对伪残差拟合的基学习器都是[回归树](https://www.edgepedia.org/zh/regression-tree)；分类分数通过 sigmoid 或 softmax 变为概率。<sup>[2](https://www.cse.chalmers.se/~richajo/dit866/files/gb_explainer.pdf)</sup> 每个新的基学习器都被构造为与整个集成所对应损失的负梯度最大程度相关。<sup>[7](https://mediatum.ub.tum.de/doc/1283951/209028.pdf)</sup>

## 实现方法

实践者选择一种损失函数（回归使用最小二乘、最小绝对偏差或 Huber-M；分类使用多类逻辑似然），然后逐阶段拟合树。<sup>[1](https://faculty.cc.gatech.edu/~zha/CS8803WST/boosting.pdf)</sup> 主要控制参数是学习率 \( \nu \)、树的数量 \( M \) 和树的复杂度。收缩以 \( \nu \) 缩放每次更新，给出两个耦合的正则化参数：减小 \( \nu \) 会增大 \( M \) 的最佳值，而将 \( \nu \) 减半大致会使所需的 \( M \) 翻倍。<sup>[1](https://faculty.cc.gatech.edu/~zha/CS8803WST/boosting.pdf)</sup><sup> • </sup><sup>[3](https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter7.html)</sup> 具有 \( J \) 个终端节点的树最多能捕捉 \( \min(J-1, n) \) 阶的交互作用，因此 \( J \) 应与变量间主导交互作用的最高阶相匹配。<sup>[1](https://faculty.cc.gatech.edu/~zha/CS8803WST/boosting.pdf)</sup>

典型值：scikit-learn 默认为 learning_rate = 0.1、n_estimators = 100 和 max_depth = 3 <sup>[4](https://sklearn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html)</sup>；gbm 包的作者建议收缩系数在 0.01 到 0.001 之间，迭代 3,000 到 10,000 次。<sup>[8](https://cran.r-project.org/web/packages/gbm/vignettes/gbm.html)</sup> 为每棵树按一定比例（袋采样比例）对数据进行子采样可增加随机性。<sup>[9](https://davidrosenberg.github.io/mlcourse/Archive/2017Fall/Lectures/11a.gradient-boosting.pdf)</sup> 训练在达到最大树数量时或验证性能开始过拟合时停止；在验证误差最小值处进行早停可以以最小的精度代价规避过拟合。<sup>[10](https://developers.google.com/machine-learning/decision-forests/intro-to-gbdt)</sup><sup> • </sup><sup>[7](https://mediatum.ub.tum.de/doc/1283951/209028.pdf)</sup>

## 起源

提升法始于 [AdaBoost](https://www.edgepedia.org/zh/adaboost)，它在训练数据上反复以重新加权的分布运行弱学习算法，并将得到的分类器组合成一个复合分类器。<sup>[11](https://www.schapire.net/papers/FreundSc96.pdf)</sup> [加利福尼亚大学](https://www.edgepedia.org/zh/university-of-california)伯克利分校（University of California, Berkeley）的统计学教授[利奥·布雷曼](https://www.edgepedia.org/zh/leo-breiman)（Leo Breiman）于 1997 年将这类方法分析为“arcing”（自适应重加权与组合）<sup>[12](https://www.stat.berkeley.edu/~breiman/games.pdf)</sup>，此前他于 1996 年引入了袋装法，该方法将在自助样本上生长的树以相等权重组合起来。<sup>[13](https://doi.org/10.1023/a:1018054314350)</sup>

提升的梯度下降视角是在卢·梅森（Llew Mason）及其同事 1999 年的工作（AnyBoost）中，以及弗里德曼（Friedman）、哈斯蒂（Hastie）和蒂布希拉尼（Tibshirani）（2000）和弗里德曼（2001）的梯度提升机中发展起来的。<sup>[7](https://mediatum.ub.tum.de/doc/1283951/209028.pdf)</sup> 梯度提升机由杰罗姆·弗里德曼（Jerome Friedman）于 2001 年在《统计年鉴》（The Annals of Statistics）上发表的《贪心函数逼近：梯度提升机》一文中引入，该文推导了一般范式和 TreeBoost 算法。<sup>[14](https://doi.org/10.1214/aos/1013203451)</sup> 他 2002 年发表在《计算统计与数据分析》（Computational Statistics & Data Analysis）上的论文《随机梯度提升》增加了每次迭代的子采样。<sup>[15](https://doi.org/10.1016/s0167-9473%2801%2900065-2)</sup>

## 变体

**XGBoost** 由陈天奇（Tianqi Chen）和卡洛斯·格斯特林（Carlos Guestrin）于 2016 年在 arXiv 上提出。<sup>[16](https://doi.org/10.48550/arxiv.1603.02754)</sup> 它增加了损失的二阶泰勒展开，因此目标函数仅依赖于每个样本的梯度 \( g_{i} \) 和海森矩阵 \( h_{i} \)，带有正则化目标函数 \( \Omega(f) = \gamma T + \tfrac{1}{2}\lambda \sum_{j} w_{j}^{2} \)、最优叶权重 \( w_{j}^{*} = -G_{j}/(H_{j}+\lambda) \)，以及分裂增益中的 \( -\gamma \) 剪枝项。<sup>[17](https://xgboost.readthedocs.io/en/latest/tutorials/model.html)</sup><sup> • </sup><sup>[6](http://dl.acm.org/doi/10.1145/2939672.2939785)</sup> 它还贡献了一种稀疏感知算法和一种用于近似树学习的加权分位数草图。<sup>[6](http://dl.acm.org/doi/10.1145/2939672.2939785)</sup>

**LightGBM** 将特征分箱为直方图，使分裂增益复杂度为 \( O(\#\text{bins}) \) 而非 \( O(\#\text{data}) \)，并按叶生长树，选择增量损失最大的叶；在固定叶数下，这比按层生长达到更低的损失，但在小数据上可能过拟合。对于具有 \( k \) 个类别的类别特征，它按 sum_gradient/sum_hessian 对类别排序，并在约 \( O(k \log k) \) 内找到最优的两个子集划分，避免了独热编码。<sup>[18](https://lightgbm.readthedocs.io/en/stable/Features.html)</sup>

**CatBoost** 由柳德米拉·普罗霍连科娃（Liudmila Prokhorenkova）、格列布·古谢夫（Gleb Gusev）、亚历山大·沃罗别夫（Aleksandr Vorobev）、安娜·韦罗妮卡·多罗古什（Anna Veronika Dorogush）和安德烈·古林（Andrey Gulin）在 2017 年的一篇论文中提出。<sup>[19](https://doi.org/10.48550/arxiv.1810.11363)</sup> 后来 2018 年关于该系统的报告由安娜·韦罗妮卡·多罗古什（Anna Veronika Dorogush）、瓦西里·叶尔绍夫（Vasily Ershov）和安德烈·古林（Andrey Gulin）发表在 arXiv 上。<sup>[19](https://doi.org/10.48550/arxiv.1810.11363)</sup><sup> • </sup><sup>[23](https://dl.acm.org/doi/10.5555/3327757.3327770)</sup> 它引入了有序提升（一种由排列驱动的经典梯度提升替代方案）和用于类别特征的有序目标统计量，两者都旨在对抗目标泄漏引起的预测偏移；其基础预测器是对称决策树（决策表），其 Ordered 模式在小数据集上最有用，在少于 40,000 个训练样本时收益最大。<sup>[20](https://proceedings.neurips.cc/paper_files/paper/2018/file/14491b756b3a51daac41c24863285549-Paper.pdf)</sup><sup> • </sup><sup>[19](https://doi.org/10.48550/arxiv.1810.11363)</sup>

**scikit-learn** 提供了原始的 GradientBoostingClassifier，它在每个阶段对负梯度拟合 \( n\_classes\_ \) 棵回归树（loss = 'exponential' 可恢复 AdaBoost），以及快得多的 HistGradientBoostingClassifier，适用于 \( n\_samples \ge 10{,}000 \) 的情况，它将输入分箱为约 256 个箱，使用海森信息，其 \( l2\_regularization \) 参数对应于 XGBoost 的 \( \lambda \)，并默认启用早停。<sup>[4](https://sklearn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html)</sup><sup> • </sup><sup>[21](https://sklearn.org/stable/modules/ensemble.html)</sup>

## 应用

GBDT 在表格预测中占主导地位。在一项 45 个数据集的基准测试中，包括 GBT 和 XGBoost 在内的基于树的模型在中等规模的表格数据集（约 10,000 个样本）上仍保持最先进水平，甚至还未计入其更快的训练速度。<sup>[5](https://papers.neurips.cc/paper_files/paper/2022/file/0378c7692da36807bdec87ab043cdadc-Paper-Datasets_and_Benchmarks.pdf)</sup> 同一项研究解释了原因：神经网络偏向于过度平滑的解，特征的随机旋转会逆转性能顺序，使网络占优（因此旋转不变性对表格数据不可取），而 GBT 的精度在移除多达一半被随机森林评为有信息的特征后几乎不受影响，因为大多数特征是无信息的。<sup>[5](https://papers.neurips.cc/paper_files/paper/2022/file/0378c7692da36807bdec87ab043cdadc-Paper-Datasets_and_Benchmarks.pdf)</sup> 最好的表格方法共享两个属性：它们是集成方法（袋装或提升），且其弱学习器是决策树。<sup>[5](https://papers.neurips.cc/paper_files/paper/2022/file/0378c7692da36807bdec87ab043cdadc-Paper-Datasets_and_Benchmarks.pdf)</sup>

在应用竞赛环境中，2015 年发表的 29 个 Kaggle 获奖方案中有 17 个使用了 XGBoost（其中 8 个仅使用 XGBoost），而深度神经网络为 11 个，KDDCup 2015 中每支排名前十的队伍都使用了它。<sup>[6](http://dl.acm.org/doi/10.1145/2939672.2939785)</sup> 在速度方面，在一项比较中，XGBoost 在训练和超参数优化方面比深度网络快一个数量级以上，而将深度模型与 XGBoost 结合的集成方法击败了任何单一模型。<sup>[22](https://arxiv.org/html/2106.03253v2)</sup>

## 局限性与替代方案

**随机森林** 使用与提升树相同的树集成模型；区别在于训练方式。<sup>[17](https://xgboost.readthedocs.io/en/latest/tutorials/model.html)</sup> 提升法对相关的浅树求和以消除偏差，而袋装法对独立的深树求平均以消除方差；由于提升法减少偏差，随着 \( M \) 增大它可能过拟合，这与随机森林不同。<sup>[3](https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter7.html)</sup>

**神经网络** 在目标平滑或旋转不变表示有帮助时可以胜出，而将它们与 XGBoost 集成可提高精度。<sup>[5](https://papers.neurips.cc/paper_files/paper/2022/file/0378c7692da36807bdec87ab043cdadc-Paper-Datasets_and_Benchmarks.pdf)</sup><sup> • </sup><sup>[22](https://arxiv.org/html/2106.03253v2)</sup>

高基数类别特征可通过 LightGBM 的 \( O(k \log k) \) 划分和 CatBoost 的有序目标统计量得到有效处理。<sup>[18](https://lightgbm.readthedocs.io/en/stable/Features.html)</sup><sup> • </sup><sup>[20](https://proceedings.neurips.cc/paper_files/paper/2018/file/14491b756b3a51daac41c24863285549-Paper.pdf)</sup>

## References

1. [Greedy Function Approximation: A Gradient Boosting Machine (Jerome H. Friedman)](https://faculty.cc.gatech.edu/~zha/CS8803WST/boosting.pdf)
2. [An intuitive explanation of gradient boosting (Richard Johansson, Chalmers)](https://www.cse.chalmers.se/~richajo/dit866/files/gb_explainer.pdf)
3. [Chapter 7: Ensemble methods; from simple decision trees to Gradient Boosting](https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/chapter7.html)
4. [GradientBoostingClassifier, scikit-learn documentation](https://sklearn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html)
5. [Why do tree-based models still outperform deep learning on typical tabular data? (Grinsztajn et al., NeurIPS 2022)](https://papers.neurips.cc/paper_files/paper/2022/file/0378c7692da36807bdec87ab043cdadc-Paper-Datasets_and_Benchmarks.pdf)
6. [XGBoost: A Scalable Tree Boosting System (Chen & Guestrin, KDD '16)](http://dl.acm.org/doi/10.1145/2939672.2939785)
7. [Gradient Boosting Machines, a Tutorial (Natekin & Knoll, Frontiers in Neurorobotics 2013)](https://mediatum.ub.tum.de/doc/1283951/209028.pdf)
8. [Generalized Boosted Models: A guide to the gbm package (Ridgeway)](https://cran.r-project.org/web/packages/gbm/vignettes/gbm.html)
9. [Gradient Boosting, David S. Rosenberg, Bloomberg ML EDU lecture notes](https://davidrosenberg.github.io/mlcourse/Archive/2017Fall/Lectures/11a.gradient-boosting.pdf)
10. [Gradient Boosted Decision Trees, Google ML Crash Course](https://developers.google.com/machine-learning/decision-forests/intro-to-gbdt)
11. [Experiments with a New Boosting Algorithm (Freund & Schapire, ICML 1996)](https://www.schapire.net/papers/FreundSc96.pdf)
12. [Prediction Games and Arcing Algorithms (Breiman, 1997/1998)](https://www.stat.berkeley.edu/~breiman/games.pdf)
13. [Leo Breiman (1996). Bagging Predictors. Machine Learning.](https://doi.org/10.1023/a:1018054314350)
14. [Jerome H. Friedman (2001). Greedy function approximation: A gradient boosting machine.. The Annals of Statistics.](https://doi.org/10.1214/aos/1013203451)
15. [Stochastic gradient boosting (Computational Statistics & Data Analysis, 2002)](https://doi.org/10.1016/s0167-9473%2801%2900065-2)
16. [Chen, Tianqi, Guestrin, Carlos (2016). XGBoost: A Scalable Tree Boosting System. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1603.02754)
17. [XGBoost documentation: Introduction to Boosted Trees](https://xgboost.readthedocs.io/en/latest/tutorials/model.html)
18. [LightGBM documentation: Optimization in Speed and Accuracy](https://lightgbm.readthedocs.io/en/stable/Features.html)
19. [Dorogush, Anna Veronika, Ershov, Vasily, Gulin, Andrey (2018). CatBoost: gradient boosting with categorical features support. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1810.11363)
20. [CatBoost: unbiased boosting with categorical features (NeurIPS 2018)](https://proceedings.neurips.cc/paper_files/paper/2018/file/14491b756b3a51daac41c24863285549-Paper.pdf)
21. [1.11. Ensembles, scikit-learn documentation](https://sklearn.org/stable/modules/ensemble.html)
22. [Tabular Data: Deep Learning is Not All You Need](https://arxiv.org/html/2106.03253v2)
23. [dl.acm.org](https://dl.acm.org/doi/10.5555/3327757.3327770)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 21, 2026; Oct 25, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods › Ensemble, boosting, and transfer methods › Boosting algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/gradient-boosted-decision-tree

English original: https://www.edgepedia.org/gradient-boosted-decision-tree
