Why Uniform Risk Bounds Need a Complexity Count
A tree may fit the observed sample well simply because its splits and leaf predictions were selected from many possibilities. A uniform risk bound quantifies how much the empirical risk can differ from population risk across the entire candidate class, rather than for one tree fixed in advance. The key ingredients are a finite count of candidate trees and concentration for each tree’s bounded loss.
The count must describe the class being searched. A finite set of split rules gives a direct count; a leaf budget limits how many rules a tree can use. Leaf predictions also contribute to the count if they are allowed to vary over a finite set. These details matter: partition counting alone does not automatically control every class with continuously varying split locations or leaf values.
Counting Trees Under a Leaf Budget
For a concrete count, suppose every internal node chooses from a fixed dictionary of \(J\) split rules. Each rule specifies how to send an observation to one of two ordered children. Consider full binary trees with at most \(K\) leaves, and suppose each leaf receives one label from a finite set \(\mathcal A\) of size \(q\). A tree with \(m\) leaves has \(m-1\) internal nodes: each internal node adds one leaf relative to a single-leaf tree.
The number of ordered full binary tree shapes with \(m\) leaves is the Catalan number \(C_{m-1}=\frac{1}{m}\binom{2m-2}{m-1}\). For each shape, there are at most \(J^{m-1}\) assignments of split rules to internal nodes and \(q^m\) assignments of labels to leaves. Some such assignments may produce the same predictor, or an empty cell; counting them anyway gives a valid upper bound.
Worked Example: Counting Trees With Three Leaves or Fewer
Suppose there are \(J=5\) available split rules, at most \(K=3\) leaves, and two possible labels per leaf, so \(q=2\). For one leaf there is one shape and one empty set of internal-node rules, giving \(1\cdot 1\cdot 2=2\) labeled trees.
For two leaves, there is one shape, one internal node, and \(2^2\) leaf-label assignments. The count is \(C_1 5^1 2^2=1\cdot5\cdot4=20\). For three leaves there are \(C_2=2\) shapes, two internal nodes, and \(2^3\) label assignments, giving \(2\cdot5^2\cdot8=400\).
Thus \(N_3\leq 2+20+400=422\). This is an upper bound, not necessarily the number of distinct predictors: different trees can represent the same partition or predictions.
A Uniform Deviation Theorem
Assume \(\mathcal G\) is a finite class of \(N\) measurable predictors, the observations are independent and identically distributed, and every loss satisfies \(0\leq \ell_g(Z)\leq1\). The bound below applies to the finite tree class just counted. Boundedness could be replaced by other tail assumptions, but then the concentration inequality would change.
Proof. Fix one predictor \(g\). Its \(n\) losses are independent random variables in \([0,1]\). Hoeffding’s inequality gives, for every \(t>0\), $$ P\bigl(|R_n(g)-R(g)|>t\bigr)\leq 2\exp(-2nt^2). $$ Taking a union bound over the \(N\) predictors, $$ P\left(\sup_{g\in\mathcal G}|R_n(g)-R(g)|>t\right) \leq 2N\exp(-2nt^2). $$ Set \(t=\sqrt{\log(2N/\delta)/(2n)}\). Then \(2N\exp(-2nt^2)=\delta\), which proves the claim. The class is finite, so the supremum is measurable. \(\square\)
Applying the theorem to the tree count replaces \(N\) by the upper bound \(N_K\). In particular, with probability at least \(1-\delta\), $$ \sup_{g\in\mathcal G_K}|R_n(g)-R(g)| \leq \sqrt{\frac{\log(2N_K/\delta)}{2n}}. $$ The dependence on the number of candidate trees is logarithmic. Increasing the tree class can worsen the guarantee, but the effect is through \(\log N_K\), not \(N_K\) itself.
Worked Example: A Numerical Uniform Risk Bound
Use the previous count \(N_3\leq422\), with sample size \(n=1000\), and take \(\delta=0.05\). The theorem gives the deviation threshold $$ \sqrt{\frac{\log(2\cdot422/0.05)}{2\cdot1000}} =\sqrt{\frac{\log(16880)}{2000}} \approx\sqrt{\frac{9.734}{2000}} \approx 0.0698. $$
Therefore, with probability at least \(0.95\), every candidate tree at once has empirical risk within about \(0.070\) of its population risk. The statement is simultaneous: it still applies if the tree is chosen after examining the sample, provided the selected tree belongs to this same finite class.
Consequences for Empirical Risk Minimization
Uniform control is useful because it transfers an empirical comparison into a population-risk comparison. Let \(\hat g\) minimize \(R_n(g)\) over a finite class \(\mathcal G\), and let \(g^\star\) minimize \(R(g)\) over that class. If the uniform deviation is at most \(\varepsilon\), then $$ R(\hat g)\leq R_n(\hat g)+\varepsilon \leq R_n(g^\star)+\varepsilon \leq R(g^\star)+2\varepsilon. $$ The middle inequality follows from empirical minimization. The first and last follow from uniform deviation, once for \(\hat g\) and once for \(g^\star\). Thus empirical risk minimization is within \(2\varepsilon\) of the best population risk available in the candidate class.
Worked Example: Choosing a Sample Size for a Target Deviation
Suppose \(N\leq422\), and we want the uniform deviation to be at most \(0.1\) with probability at least \(0.95\). It is sufficient that $$ \sqrt{\frac{\log(2N/0.05)}{2n}}\leq0.1, \qquad n\geq\frac{\log(2N/0.05)}{2(0.1)^2}. $$ Using \(N=422\), the right-hand side is \(\log(16880)/0.02\approx486.7\). Thus \(n=487\) is sufficient under this bound. It follows that an empirical risk minimizer is within \(0.2\) of the best tree’s population risk in the class, with probability at least \(0.95\).
Continuous Leaf Values and the Limits of Counting
Regression trees often use real-valued leaf predictions rather than a finite label set. One simple finite reduction is available when predictions lie in \([0,1]\), responses lie in \([0,1]\), and the loss is squared error. Round every leaf prediction to the nearest point on a grid in \([0,1]\) with spacing at most \(h\). If \(a\) is a leaf value and \(a'\) its rounded value, then \(|a-a'|\leq h/2\), and for any response \(y\in[0,1]\), $$ |(a-y)^2-(a'-y)^2| =|a-a'||a+a'-2y| \leq |a-a'|\cdot2 \leq h. $$ Consequently, both the empirical risk and population risk change by at most \(h\) on rounding, so the absolute deviation changes by at most \(2h\).
Worked Example: Discretizing Bounded Regression Leaves
Suppose there are \(J=3\) candidate split rules, at most two leaves, and a grid of 101 possible leaf values from 0 to 1 in increments of \(0.01\). The finite grid class has at most \(101+3(101^2)=30{,}704\) trees: the first term counts one-leaf trees and the second counts two-leaf trees. For squared loss with \(Y\in[0,1]\), rounding any leaf value to the nearest grid point changes each loss by at most \(h=0.01\), so it changes a deviation by at most \(0.02\).
At \(n=10{,}000\) and \(\delta=0.05\), the finite-class deviation bound is $$ \sqrt{\frac{\log(2\cdot30{,}704/0.05)}{20{,}000}} =\sqrt{\frac{\log(1{,}228{,}160)}{20{,}000}} \approx\sqrt{\frac{14.02}{20{,}000}} \approx0.0265. $$ The resulting bound for the original continuous leaf values is at most \(0.0265+0.02=0.0465\), with probability at least \(0.95\), for this fixed split dictionary and leaf budget.
The qualification about the split dictionary is essential. If split locations can vary continuously, the set of possible partitions is generally not finite, and counting tree shapes alone does not bound the number of predictors. A split can move between observed covariate values without changing the sample partition while changing predictions away from the sample. Controlling that broader class requires an appropriate complexity or entropy argument, such as one based on a growth function or covering numbers; the finite-class union bound above does not provide it by itself.
Common Pitfall and Practical Meaning
A common mistake is to count only the tree topologies and then claim a uniform bound for every tree with arbitrary split locations and real-valued leaves. The topology count omits both the choices of split rules and the choices of leaf predictions. Even if the sample induces only a limited number of observed partitions, trees that agree on the sample need not have the same population risk. The correction is to state exactly what is finite, count all choices that make the candidate class distinct, and use a concentration result justified for that class.
Within a finite candidate class, the result explains a basic trade-off: allowing more leaves can make better-fitting trees available, but also increases the count \(N_K\) and therefore the uniform deviation term. A risk analysis must keep these two effects separate. The bound controls estimation across the searched class; it does not say that the best tree in that class approximates the underlying regression or classification rule well.
Check Your Understanding
Use the assumptions stated in each question.
- Why does a full binary tree with \(m\) leaves have \(m-1\) internal nodes?
- For a finite class of \(N\) predictors with losses in \([0,1]\), what sample-size condition makes the uniform deviation bound at most \(\varepsilon\) with probability at least \(1-\delta\)?
- Explain why the empirical risk minimizer’s risk bound contains twice the uniform deviation, rather than once.
- In the regression-grid example, why can rounding change the absolute risk deviation by at most \(2h\), even though each loss changes by at most \(h\)?
- Why is counting tree shapes insufficient when split locations vary continuously?