Trees as Adaptive Partitions
Consistency, bias–variance and the instability of single trees.
A tree is a histogram whose bins are chosen by the data. Seen that way, questions about trees become questions about partitioning estimators: when they converge to the best possible predictor, how fast, why a single tree's partition swings so wildly with the sample, and how to make its leaf estimates honest enough for confidence intervals.
What you’ll learn
- Write tree predictions as local averages over data-dependent cells, and state when partitioning estimates are universally consistent.
- Derive the bias–variance bound for a cubic partition and the resulting rate for Lipschitz regression functions, and explain what adaptive cells can and cannot gain.
- Explain why greedy trees are unstable, and compute how bagging smooths a hard threshold.
- Define honest trees, and explain the selection bias they remove and the inference they make possible.
Trees as local averages
Every tree prediction is a local average. If the leaves partition the input space into cells, and is the cell containing with training points, a regression tree predicts
Plug-in rules inherit their quality from the regression estimate. Where disagrees with the Bayes rule, and lie on opposite sides of , so the extra conditional error is at most . Averaging over bounds the excess over the Bayes error (Devroye, Györfi & Lugosi, 1996):
Condition (i) kills the bias and condition (ii) the variance: cells shrink, yet hold more and more points on average. When the partition depends on the data, as a tree's does, these conditions are not enough on their own. Lugosi & Nobel (1996) gave conditions for data-dependent partitions: in addition, the family of partitions the rule can produce must not be too rich (its combinatorial complexity must grow subexponentially, a Vapnik–Chervonenkis-type requirement), and the cells must shrink and fill up in probability. Rules such as statistically equivalent blocks, which split at order statistics of the inputs, meet them. Greedy CART splits, chosen to fit the labels, are much harder to analyze, and their consistency in general is only partly understood.
Bias, variance and the rate
To see the trade-off quantitatively, take , a regular partition into cubes of side , a regression function that is -Lipschitz, and noise with .
Condition on the inputs. In a cell with points, the estimate averages independent responses, so its variance is at most ; its mean averages over points of , each within of :
Average over the inputs. is Binomial, and , since and . An empty cell predicts 0 and costs at most , with probability . Weighting each cell by and summing over the cells:
The variance term grows like as cells shrink; the squared bias grows like as they widen. Balancing them gives the best side length and the rate:
Stone (1982) showed that is the minimax rate over Lipschitz regression functions: no estimator does better uniformly over the class. The exponent decays with , the curse of dimensionality. Smoother functions do not help a piecewise-constant fit, whose bias inside a cell stays of order wherever the gradient is nonzero.
At the rate , by what factor must grow to halve the mean squared error when ?
Show the answer
64 ×
For the error scales as , so halving it needs times more data. For the factor is 4; for it is .
What adaptivity buys. A tree's cells are not regular cubes: greedy splitting concentrates cuts where changes fast and on the coordinates it depends on. If depends on only coordinates and the splits find them, the effective dimension in the rate is , not . Stylized forest models make this precise, with rates that depend only on the number of strong features (Biau, 2012; Random Forest Theory). But greedy cuts can also be fooled, as the parity examples of Optimal & Interpretable Trees show, and no general guarantee covers them. Averaging many randomized partitions can even beat the piecewise-constant limit: Mondrian forests attain the minimax rate for functions with Hölder smoothness between 1 and 2, which single trees cannot (Mourtada, Gaïffas & Scornet, 2020).
Instability, and how averaging smooths it
Greedy trees are unstable: the partition depends on the data through a cascade of argmax choices, and near-ties flip under tiny perturbations, changing everything below them. Breiman (1996) made instability precise for model selection, where a procedure is unstable if a small change in the data can produce a large change in the selected predictor, and related the predictive loss from selection to it. The simplest unstable predictor is a hard threshold, the building block of every tree, and Bühlmann & Yu (2002) analyzed exactly such hard decisions to explain why bagging helps. A stylized version of their calculation:
A split point is estimated with , and the prediction at is . Look within the sampling noise of the true split, at :
Bagging averages the predictor over bootstrap resamples. If the bootstrap distribution of around mimics that of around , the bagged prediction is a smooth function of :
At the split point itself (), is uniform on , so the variance falls from to , a factor of 3. Away from the split the gain shrinks (to about 1.3 at ), and the bagged mean is a gentler ramp than : bagging trades a little bias for much less variance near the boundary.
A tree is a cascade of such thresholds, each feeding the next, so its instability compounds, and so does what averaging removes. Bagging is bootstrap smoothing: it replaces a predictor by its bootstrap expectation, which matters for hard, discontinuous decisions and changes little for smooth, stable estimators such as least squares.
In the stylized threshold model, a point sits exactly at the true split (). By what factor does bagging reduce the variance of the prediction there?
- 1: bagging does not change the variance
- 2
- 3
Show the answer
C. 3
Unbagged, the prediction is a fair coin flip, , with variance . Bagged, it is , which is uniform on and has variance . The ratio is 3, a constant: the gain does not grow with , because both versions vary on the same scale.
Honest trees and inference
Adaptive cells cause a second problem: selection bias. A greedy split is placed where the two children's sample means differ most, so the fitted leaf means overstate the true differences. Even when is independent of , the leaf means of a fitted tree spread out more than the truth warrants, and confidence intervals computed as if the partition had been fixed in advance cover the truth less often than they claim.
Athey & Imbens (2016) introduced honest trees to estimate heterogeneous treatment effects, with splitting rules aimed at effects rather than outcomes. In their simulations, honest estimation gave confidence intervals with close to nominal coverage while adaptive versions undercovered, at a moderate cost in mean squared error from using each half of the data for one task only. Wager & Athey (2018) built random forests from honest trees grown on subsamples and proved that their predictions are consistent and asymptotically normal, with a variance estimate from the infinitesimal jackknife. Random Forest Theory states the theorem, and Causal Inference with Machine Learning puts it to work in causal forests.
Think first The response is pure noise, independent of . You grow a depth-1 tree on 100 points, choosing the threshold that makes the two children's means differ most, then report a textbook 95% interval for each child's mean. Why will these intervals cover the true mean (the same for both children) less than 95% of the time, and how does honesty repair them?
The threshold was chosen to push the two means apart, so the reported means are selected for being extreme: they sit in the tails of their sampling distributions more often than chance allows, and intervals centered on them miss the truth too often. Re-estimating each child's mean on a fresh half of the data, whose responses played no part in choosing the threshold, gives averages of independent draws, and the textbook intervals are valid again, conditional on the split.
Key takeaways
- Trees are partitioning estimates with data-dependent cells. For plug-in classifiers, , so consistent regression gives consistent classification.
- Fixed partitions are universally consistent when cells shrink and hold ever more points; data-dependent partitions also need limited combinatorial richness (Lugosi & Nobel, 1996). Greedy CART is only partly understood.
- For cubic cells of side , the error is at most of order , optimized at : the minimax rate for Lipschitz functions. Adaptivity helps when splits find the relevant coordinates; piecewise constants cannot exploit extra smoothness.
- Hard thresholds make trees unstable. Bagging smooths into , cutting the variance at the split point from to .
- Honest trees separate partitioning from estimation, removing selection bias; they underpin asymptotically normal forest estimates and causal forests.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
For a partitioning regression estimate with partitions fixed in advance, which pair of conditions gives weak universal consistency?
- The cells shrink, and every cell contains at least one training point
- The cells shrink, and the number of cells meeting any fixed ball grows more slowly than
- The number of cells grows like , so each holds about one point
- The cells stay fixed while grows
Show the answer
B. The cells shrink, and the number of cells meeting any fixed ball grows more slowly than
Shrinking cells make the bias vanish; having cells in any bounded region makes the average number of points per cell grow, so the variance vanishes too.
For a -Lipschitz regression function on and a partition into cubes of side , what side length minimizes the bound on the mean squared error?
Show the answer
D.
The bound is of order . Setting the derivative to zero gives , and the error is then of order , the minimax rate for Lipschitz functions.
Why does bagging help a decision tree much more than it helps ordinary least squares?
- Trees are built from hard, discontinuous threshold decisions that flip under small perturbations; averaging over resamples smooths them, while least squares is already a smooth function of the data
- Least squares cannot be fitted to bootstrap samples
- Bagging reduces bias, and only trees are biased
- Trees are fitted by gradient descent, which bagging accelerates
Show the answer
A. Trees are built from hard, discontinuous threshold decisions that flip under small perturbations; averaging over resamples smooths them, while least squares is already a smooth function of the data
Bagging replaces a predictor by its bootstrap average. For a hard threshold this turns a 0/1 jump into a ramp and cuts the variance near the split (by a factor of 3 at the split point in the stylized model). A smooth estimator is nearly linear in the data on the scale of resampling noise, so averaging changes it little.
What does honesty, using separate samples to choose a tree's partition and to estimate its leaf values, achieve?
- It makes the tree consistent for every distribution
- It removes the selection bias of leaf means fitted on the same data that chose the splits, so standard errors and intervals become valid, at the cost of using fewer points for each task
- It makes the tree more accurate, because it uses more data
- It guarantees the same partition on every resample
Show the answer
B. It removes the selection bias of leaf means fitted on the same data that chose the splits, so standard errors and intervals become valid, at the cost of using fewer points for each task
Conditional on a partition chosen from one half, the leaf means from the other half are averages of independent responses, so the usual variance formulas apply. Wager & Athey (2018) build asymptotically normal forests on this property.
Further reading
- L. Devroye, L. Györfi & G. Lugosi, A Probabilistic Theory of Pattern Recognition (Springer, 1996).
- L. Györfi, M. Kohler, A. Krzyżak & H. Walk, A Distribution-Free Theory of Nonparametric Regression (Springer, 2002).
- G. Lugosi & A. Nobel, "Consistency of data-driven histogram methods for density estimation and classification," Annals of Statistics 24(2), 687–706 (1996).
- P. Bühlmann & B. Yu, "Analyzing bagging," Annals of Statistics 30(4), 927–961 (2002).
- S. Wager & S. Athey, "Estimation and inference of heterogeneous treatment effects using random forests," Journal of the American Statistical Association 113(523), 1228–1242 (2018).