# 回归树

回归树是一种统计与机器学习方法，它通过递归地将数据划分成若干区域，并在每个区域内预测一个单一值（通常是响应变量的均值），来预测连续型结果。它与分类树的区别在于输出和分裂准则：分类树使用基尼指数 \( i(t) = 1 - \sum_{j} p^{2}(j|t) \) 作为不纯度来预测多数类，而回归树使用残差平方和，并在每个叶节点预测训练样本均值。<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup> 预测结果是分段常数，既不光滑也不连续，这使得树在外推方面表现很差。<sup>[2](https://sklearn.org/stable/modules/tree.html)</sup> 在多个最优性准则下，学习最优树是NP完全的，因此实用算法都是贪心启发式方法。<sup>[2](https://sklearn.org/stable/modules/tree.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 模型输出 | 分段常数函数；每个叶节点预测其训练观测的均值（或中位数）响应<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup> |
| 分裂准则 | 残差平方和的减少量（或绝对误差、泊松偏差）<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup> |
| 首次发表的算法 | AID，摩根与桑奎斯特，Journal of the American Statistical Association，1963年<sup>[3](https://doi.org/10.1080/01621459.1963.10500855)</sup> |
| 奠定现代处理方式的著作 | 《Classification and Regression Trees》，布雷曼、弗里德曼、奥尔申与斯通，1984年，368页<sup>[4](https://books.google.com/books/about/Classification_and_Regression_Trees.html?id=8k1DvQEACAAJ)</sup> |
| 规模控制 | 代价复杂度（最弱环节）剪枝，配合10折交叉验证与1-SE规则<sup>[5](https://ai.stanford.edu/~ronnyk/treesHB.pdf)</sup> |
| 贪心学习代价 | CART与C4.5的平均情况为 \( O(p \cdot N \log^{2}(N)) \)<sup>[6](https://klusowski.princeton.edu/sites/g/files/toruqf5901/files/documents/klusowski2024large.pdf)</sup> |
| 当前地位 | 树集成方法被广泛认为在中型表格数据集上达到最先进水平<sup>[7](https://arxiv.org/html/2411.04394)</sup> |

## 工作原理

回归树拟合如下形式的函数：\( f(x) = \sum_{m} c_{m} \cdot I[x \in R_{m}] \)，其中 \( R_{m} \) 是预测变量空间中互不重叠的区域，\( c_{m} \) 是区域 \( m \) 的最优常数，即该区域内训练响应值的均值。<sup>[8](https://people.cs.umass.edu/~domke/courses/sml/12trees.pdf)</sup> 这些区域通过递归二叉分裂找到：从全部数据开始，算法遍历每个预测变量和每个候选阈值，寻找能最大程度降低残差平方和的分裂，\( \mathrm{RSS} = \sum_{j} \sum_{i \in R_{j}} (y_{i} - \hat{y}_{R_{j}})^{2} \)，然后在每个子节点内重复此过程。<sup>[9](https://www2.stat.duke.edu/~rcs46/lectures_2017/08-trees/08-tree-regression.pdf)</sup>

CART将此形式化为不纯度下降：分裂的优良程度为 \( \Delta_{i}(s,t) = i(t) - p_{L} \cdot i(t_{L}) - p_{R} \cdot i(t_{R}) \)，选择使其最大化的分裂。<sup>[10](https://api.pageplace.de/preview/DT0400.9781351460491_A31471984/preview-9781351460491_A31471984.pdf)</sup> 对于回归问题，不纯度 \( i(t) \) 是节点的均方误差，即残差平方和除以该节点的观测数。<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup> 对于连续特征，只需检查相邻排序值之间的中点，每个特征有 \( n - 1 \) 个候选分裂。<sup>[11](https://davidrosenberg.github.io/mlcourse/Archive/2017/Lectures/8a.trees.pdf)</sup> 所有分裂都是轴对齐的，因此划分是预测变量空间中的一组矩形。<sup>[8](https://people.cs.umass.edu/~domke/courses/sml/12trees.pdf)</sup>

## 实施方法

标准CART流程首先生长一棵大树，仅当终端节点将包含少于最小观测数（通常为5）时停止。<sup>[11](https://davidrosenberg.github.io/mlcourse/Archive/2017/Lectures/8a.trees.pdf)</sup><sup> • </sup><sup>[12](https://nchenderson.github.io/elements-nonpar-stat/decision-tree.html)</sup> 然后通过最弱环节切割对大树进行剪枝，各环节以代价复杂度参数为索引。<sup>[13](https://pages.stat.wisc.edu/~loh/treeprogs/guide/LohISI14.pdf)</sup> 准则为 \( C_{\alpha}(T) = \hat{R}(T) + \alpha|T| \)，其中 \( |T| \) 计算终端节点数；布雷曼及其同事证明只需评估全树的子树，因此剪枝产生一个嵌套的最优子树序列。<sup>[11](https://davidrosenberg.github.io/mlcourse/Archive/2017/Lectures/8a.trees.pdf)</sup> 剪枝代价通过K折交叉验证估计，通常为10折，1-SE规则选择估计误差不超过最优树估计误差加一个标准误的最小树。<sup>[5](https://ai.stanford.edu/~ronnyk/treesHB.pdf)</sup>

在scikit-learn的DecisionTreeRegressor中，ccp_alpha实现最小代价复杂度剪枝，criterion选项可选择squared_error（叶均值）、absolute_error（叶中位数）或poisson（泊松偏差）。<sup>[14](https://scikit-learn.org/stable/auto_examples/tree/plot_tree_regression.html)</sup><sup> • </sup><sup>[2](https://sklearn.org/stable/modules/tree.html)</sup>

## 起源

回归树起源于詹姆斯·N·摩根（James N. Morgan）和约翰·A·桑奎斯特（John A. Sonquist）的自动交互检测（AID）程序，其成果以《Problems in the Analysis of Survey Data, and a Proposal》为题发表于1963年的Journal of the American Statistical Association。<sup>[3](https://doi.org/10.1080/01621459.1963.10500855)</sup> 洛（Loh）将AID描述为文献中首次发表的回归树算法；它使用偏差平方和作为节点不纯度，选择使子节点不纯度之和最小的分裂，并预测节点样本均值，产生分段常数回归估计。<sup>[13](https://pages.stat.wisc.edu/~loh/treeprogs/guide/LohISI14.pdf)</sup>

布雷曼（Breiman）和弗里德曼（Friedman）于1973年各自独立开始使用树方法，后来斯通（Stone）加入，奥尔申（Olshen）贡献了理论和早期医学应用。<sup>[10](https://api.pageplace.de/preview/DT0400.9781351460491_A31471984/preview-9781351460491_A31471984.pdf)</sup> CART带来了最弱环节代价复杂度剪枝，解决了AID和THAID的欠拟合与过拟合问题，还带来了用于缺失数据的替代分裂。<sup>[13](https://pages.stat.wisc.edu/~loh/treeprogs/guide/LohISI14.pdf)</sup><sup> • </sup><sup>[4](https://books.google.com/books/about/Classification_and_Regression_Trees.html?id=8k1DvQEACAAJ)</sup>

## 变体

M5由J. R. 昆兰（J. R. Quinlan）在《Learning With Continuous Classes》（1992）中提出，它构建的模型树在每个叶节点包含一个多元线性回归模型，通过目标变量标准差的期望减少量来选择分裂。<sup>[15](https://sci2s.ugr.es/keel/pdf/algorithm/congreso/1992-Quinlan-AI.pdf)</sup> 叶节点上的模型树由弗兰克（Frank）及其同事在《Using Model Trees for Classification》（Machine Learning，1998）中进一步发展。<sup>[16](https://doi.org/10.1023/a:1007421302149)</sup> 在分类方面，ID3由J. R. 昆兰在《Induction of Decision Trees》（Machine Learning，1986）中提出，<sup>[17](https://doi.org/10.1023/a:1022643204877)</sup> C4.5以基于熵的增益率对其进行了扩展。<sup>[13](https://pages.stat.wisc.edu/~loh/treeprogs/guide/LohISI14.pdf)</sup>

条件推断树（ctree）通过置换检验的p值选择变量，将变量选择与分裂分开。<sup>[13](https://pages.stat.wisc.edu/~loh/treeprogs/guide/LohISI14.pdf)</sup><sup> • </sup><sup>[18](https://cran.r-project.org/web/packages/partykit/vignettes/ctree.pdf)</sup> 基于模型的递归分割（MOB）由阿希姆·蔡莱斯（Achim Zeileis）、托尔斯滕·霍索恩（Torsten Hothorn）和库尔特·霍尼克（Kurt Hornik）于2008年提出，它在每个节点拟合参数模型，并基于参数不稳定性进行分裂。<sup>[19](https://doi.org/10.1198/106186008x319331)</sup> GUIDE为最小二乘、分位数、泊松和比例风险回归构建分段常数、多元线性和简单多项式模型，并进行无偏变量选择。<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup> evtree由托马斯·格鲁宾格（Thomas Grubinger）、阿希姆·蔡莱斯和卡尔-彼得·普法伊费尔（Karl-Peter Pfeiffer）于2014年提出，它通过进化搜索全局优化树，但不提供最优性证明。<sup>[20](https://doi.org/10.18637/jss.v061.i01)</sup>

单棵树是高方差模型：将树拟合到训练数据的两个随机半样本可能产生相当不同的结果，如果数据的小变化改变了首次分裂变量或切分点，整个树结构可能随之改变。<sup>[21](https://www.eecis.udel.edu/~shatkay/Course/papers/RandomForestGentleIntro2009.pdf)</sup> 集成方法解决了这一问题。Bagging由利奥·布雷曼（Leo Breiman）在《Bagging Predictors》（Machine Learning，1996）中提出，它对在自助样本上生长的树的预测值取平均。<sup>[22](https://doi.org/10.1023/a:1018054314350)</sup> 随机森林通过限制每次分裂时考虑的预测变量（mtry）增加了第二个多样性来源；布雷曼的理论将集成的泛化误差界与个体树之间的相关性联系起来，因此低相关性降低该界。<sup>[21](https://www.eecis.udel.edu/~shatkay/Course/papers/RandomForestGentleIntro2009.pdf)</sup> 提升法在当前拟合的残差上顺序生长树，使用收缩参数 \( \lambda \) 和交互深度 \( d \)；BART是一种贝叶斯树加和模型，其树结构和叶值从后验分布中采样，通常通过迭代贝叶斯回填MCMC实现。<sup>[23](https://www.statistical.dog/book/08-trees)</sup>

最优稀疏回归树（OSRT）由张（Zhang）及其同事于2022年提出，它使用带界限的动态规划，构建在GOSDT框架之上，寻找可证明最优的稀疏回归树；在比较的方法（CART、GUIDE、IAI、evtree）中，这些树展现出最佳的泛化能力。<sup>[24](https://ojs.aaai.org/index.php/AAAI/article/download/26334/26106)</sup><sup> • </sup><sup>[25](https://doi.org/10.48550/arxiv.2211.14980)</sup> 超级贪婪树由赫曼特·伊什瓦兰（Hemant Ishwaran）（Artificial Intelligence Review，2026）提出，它通过在每个节点拟合lasso惩罚模型来扩展CART，以产生自适应的多元切割，其森林扩展在复杂响应曲面上相对于CART、斜树、随机森林和梯度提升树表现良好。<sup>[26](https://link.springer.com/article/10.1007/s10462-026-11541-6)</sup>

## 应用

在平滑问题上，单棵回归树往往不如更简单的模型。在洛的汽车示例中，RPART（CART）模型的 \( R^{2} \) 达到75%，而多元线性模型为81%。<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup> 在按MCAR和MAR方案模拟缺失的24个真实数据集上，在九种预测模型中，基于树的方法从最好（GUIDE）到最差（M5和RPART）不等。<sup>[27](https://www3.stat.sinica.edu.tw/statistica/oldpdf/A30n402.pdf)</sup>

与线性回归的比较结果不一。在60个连续自变量模拟示例中，无论变量数量和样本大小如何，线性回归都优于决策树和神经网络。<sup>[28](https://www.sciencedirect.com/science/article/abs/pii/S0957417406004118)</sup> 树集成方法被广泛认为在中型表格数据集上达到最先进水平。<sup>[7](https://arxiv.org/html/2411.04394)</sup>

## 局限与替代方案

预测结果是分段常数且在区域之间不连续，因此树对平滑函数的近似很差，且无法外推到训练数据范围之外。<sup>[2](https://sklearn.org/stable/modules/tree.html)</sup> 它们对学习数据的微小变化也不稳定。<sup>[21](https://www.eecis.udel.edu/~shatkay/Course/papers/RandomForestGentleIntro2009.pdf)</sup> CART的分裂方法偏向于具有更多不同值的变量，因为具有 \( m \) 个不同值的变量在非分类情况下允许 \( m - 1 \) 个分裂，在分类情况下允许 \( 2^{m-1} - 1 \) 个分裂，同时也偏向于具有更多缺失值的变量。<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup>

每种失效模式都有补救措施：替代分裂处理缺失数据并提供变量重要性得分，<sup>[13](https://pages.stat.wisc.edu/~loh/treeprogs/guide/LohISI14.pdf)</sup> 条件推断树通过将变量选择与分裂分开来避免对具有许多可能分裂或许多缺失值的协变量的系统性偏向，<sup>[18](https://cran.r-project.org/web/packages/partykit/vignettes/ctree.pdf)</sup> GUIDE使用无偏两步选择，<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup> 而斜（线性组合）分裂在经验上比单变量分裂具有好得多的预测精度。<sup>[1](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)</sup> 根据模拟得出的经验法则，当预测变量为连续型且关系平滑时，优先使用线性回归；树通过可解释性和交互作用的自动建模赢得其地位。<sup>[28](https://www.sciencedirect.com/science/article/abs/pii/S0957417406004118)</sup> 尚无已发表的直接对比基准量化回归树与k近邻或核方法的性能。

## References

1. [Classification and Regression Tree Methods (Loh, Encyclopedia of Statistics in Quality and Reliability, 2008)](https://pages.stat.wisc.edu/~loh/treeprogs/guide/eqr.pdf)
2. [1.10. Decision Trees, scikit-learn documentation](https://sklearn.org/stable/modules/tree.html)
3. [James N. Morgan, John A. Sonquist (1963). Problems in the Analysis of Survey Data, and a Proposal. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1963.10500855)
4. [Classification and Regression Trees, Google Books bibliographic record](https://books.google.com/books/about/Classification_and_Regression_Trees.html?id=8k1DvQEACAAJ)
5. [Decision Tree Discovery (handbook chapter covering C4.5 and CART)](https://ai.stanford.edu/~ronnyk/treesHB.pdf)
6. [Large Scale Prediction with Decision Trees (Klusowski & Tian)](https://klusowski.princeton.edu/sites/g/files/toruqf5901/files/documents/klusowski2024large.pdf)
7. [Statistical-Computational Trade-offs for Recursive Adaptive Partitioning Estimators (arXiv, Nov 2024)](https://arxiv.org/html/2411.04394)
8. [Statistical Machine Learning Notes 12: Trees (J. Domke, UMass)](https://people.cs.umass.edu/~domke/courses/sml/12trees.pdf)
9. [Tree Based Methods: Regression Trees (Duke STA course notes, ISLR-based)](https://www2.stat.duke.edu/~rcs46/lectures_2017/08-trees/08-tree-regression.pdf)
10. [Classification and Regression Trees (Breiman, Friedman, Olshen, Stone, 1984), book preview](https://api.pageplace.de/preview/DT0400.9781351460491_A31471984/preview-9781351460491_A31471984.pdf)
11. [Classification and Regression Trees (NYU DS-GA 1003, D. Rosenberg)](https://davidrosenberg.github.io/mlcourse/Archive/2017/Lectures/8a.trees.pdf)
12. [Chapter 14: Regression Trees and CART (Elements of Nonparametric Statistics, N. Henderson)](https://nchenderson.github.io/elements-nonpar-stat/decision-tree.html)
13. [Fifty Years of Classification and Regression Trees (Loh, 2014)](https://pages.stat.wisc.edu/~loh/treeprogs/guide/LohISI14.pdf)
14. [Decision Tree Regression, scikit-learn documentation](https://scikit-learn.org/stable/auto_examples/tree/plot_tree_regression.html)
15. [Learning with Continuous Classes (M5, Quinlan 1992)](https://sci2s.ugr.es/keel/pdf/algorithm/congreso/1992-Quinlan-AI.pdf)
16. [Eibe Frank and colleagues (1998). Using Model Trees for Classification. Machine Learning.](https://doi.org/10.1023/a:1007421302149)
17. [J.R. Quinlan (1986). Induction of Decision Trees. Machine Learning.](https://doi.org/10.1023/a:1022643204877)
18. [ctree: Conditional Inference Trees (partykit vignette)](https://cran.r-project.org/web/packages/partykit/vignettes/ctree.pdf)
19. [Achim Zeileis, Torsten Hothorn, Kurt Hornik (2008). Model-Based Recursive Partitioning. Journal of Computational and Graphical Statistics.](https://doi.org/10.1198/106186008x319331)
20. [Thomas Grubinger, Achim Zeileis, Karl-Peter Pfeiffer (2014). evtree: Evolutionary Learning of Globally Optimal Classification and Regression Trees inR. Journal of Statistical Software.](https://doi.org/10.18637/jss.v061.i01)
21. [An Introduction to Recursive Partitioning (Strobl, Malley & Tutz, WIREs Cognitive Science 2009)](https://www.eecis.udel.edu/~shatkay/Course/papers/RandomForestGentleIntro2009.pdf)
22. [Leo Breiman (1996). Bagging Predictors. Machine Learning.](https://doi.org/10.1023/a:1018054314350)
23. [Tree-Based Methods (ISLR-style textbook chapter)](https://www.statistical.dog/book/08-trees)
24. [Optimal Sparse Regression Trees (AAAI 2023)](https://ojs.aaai.org/index.php/AAAI/article/download/26334/26106)
25. [Zhang, Rui and colleagues (2022). Optimal Sparse Regression Trees. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2211.14980)
26. [Super greedy trees (Artificial Intelligence Review, 2026)](https://link.springer.com/article/10.1007/s10462-026-11541-6)
27. [Missing Data, Imputation and Regression Trees (Statistica Sinica)](https://www3.stat.sinica.edu.tw/statistica/oldpdf/A30n402.pdf)
28. [Comparison of the decision tree, artificial neural network, and linear regression methods based on the number and types of independent variables and sample size (Expert Systems with Applications)](https://www.sciencedirect.com/science/article/abs/pii/S0957417406004118)

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

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Multivariate association and dimension reduction › Titles Mo to W

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/regression-tree

English original: https://www.edgepedia.org/regression-tree
