Why Model Predictions Can Be Built From Trees
A decision tree makes a prediction by applying a sequence of rules and returning the value attached to the terminal leaf. A single tree can be useful, but a tree with only a few leaves may not capture all the patterns in the data. Gradient boosting builds a model from a sequence of trees: rather than treating every tree as a separate estimate to average, it adds each tree’s output to the prediction already in place.
The central idea is that each new tree contributes an adjustment on the model’s prediction scale. For a regression model with an identity link, that is the response scale. For a binary classifier using logistic scores, the additive scale is log-odds, and the final score is transformed to a probability. These are different interpretations of the same additive structure.
In regression with an identity link, \(F_M(x)\) itself is the predicted response. In a binary logistic model, \(F_M(x)\) can be a log-odds score; the predicted probability is then \(1/(1+\exp(-F_M(x)))\). The output scale matters: adding probabilities is not the same as adding log-odds, and tree outputs should not be combined on an incompatible scale.
Why the Prediction Is a Sum
The additive form follows directly from the update rule. Begin with the initial prediction \(F_0(x)\). At step \(m\), the model retains its current prediction and adds the scaled output of the next tree. Repeated substitution gives the stated sum.
This is a justification of the additive representation, not a claim that the trees are fitted independently. The order matters to how the model is constructed: a later tree is introduced after earlier contributions are already part of the current prediction. The detailed fitting criteria and update calculations depend on the selected loss function; the sum itself describes how the resulting tree outputs combine.
Worked Example: Adding Tree Corrections to a Severity Prediction
A hypothetical insurer models claim severity in thousands of dollars using three boosted trees. The initial prediction is \(F_0=12\), and the shrinkage factor is \(\eta=0.5\). For one policy, the three trees return raw leaf values \(+4\), \(-2\), and \(+1\), respectively. Calculate the final prediction. State the contribution from each tree and check the result by using the sum formula.
Method. Scale each tree’s leaf value by \(\eta\), then add the resulting adjustment to the current prediction. The negative second-tree output lowers the prediction; it is not a separate severity estimate.
After tree 1, the adjustment is \(0.5(4)=2\), so the current prediction is \(12+2=14\). After tree 2, the adjustment is \(0.5(-2)=-1\), giving \(14-1=13\). After tree 3, the adjustment is \(0.5(1)=0.5\), giving \(13+0.5=13.5\).
The direct check is \(12+0.5[4+(-2)+1]=12+0.5(3)=13.5\). The predicted severity is therefore $13,500, since the response was measured in thousands of dollars. The calculation avoids the common mistake of averaging the three tree outputs or reporting one tree’s leaf value as the prediction.
Small Trees Can Combine Their Rules
Each individual tree partitions predictor space into regions and assigns a value to each region. A boosted model adds the value from the region selected by each tree. As a result, the final prediction reflects the combination of several partitions. Different trees can respond to different predictors, or refine patterns that a previous tree did not capture.
This does not mean that the sum is necessarily identical to one of the component trees. Nor does it mean that a sum of trees can never be represented by a single tree: in principle, a sufficiently refined tree can sometimes reproduce the same predictions. The practical distinction is how the model is constructed and constrained. A boosted model accumulates outputs from a sequence of trees; fitting one large tree creates one partition and assigns predictions directly to its leaves.
Worked Example: Combining Age and Vehicle-Type Adjustments
A hypothetical repair-cost model starts at \(F_0=100\) dollars and uses \(\eta=0.5\). Tree 1 uses age: it returns \(+20\) for vehicles at least 60 months old and \(-10\) otherwise. Tree 2 uses vehicle type: it returns \(+8\) for electric vehicles and \(-4\) for other vehicles. Tree 3 uses a further set of rules: it returns \(+6\) for a vehicle at least 60 months old that is not electric, and \(-2\) for a vehicle younger than 60 months that is electric. For each of two vehicles, calculate the final prediction.
Method. For each vehicle, identify one leaf in every tree, scale its output by \(0.5\), and add all contributions to the same initial prediction.
Vehicle A is 70 months old and not electric. Tree 1 returns \(+20\), contributing \(0.5(20)=10\). Tree 2 returns \(-4\), contributing \(0.5(-4)=-2\). Tree 3 returns \(+6\), contributing \(0.5(6)=3\). The prediction is \(100+10-2+3=\textbf{\$111}\).
Vehicle B is 35 months old and electric. Tree 1 returns \(-10\), contributing \(0.5(-10)=-5\). Tree 2 returns \(+8\), contributing \(0.5(8)=4\). Tree 3 returns \(-2\), contributing \(0.5(-2)=-1\). The prediction is \(100-5+4-1=\textbf{\$98}\).
As a check, the raw tree-output sums are \(20-4+6=22\) for Vehicle A and \(-10+8-2=-4\) for Vehicle B. Scaling and adding the base gives \(100+0.5(22)=111\) and \(100+0.5(-4)=98\). The common trap is to use the age-based tree alone or to apply only the last tree’s rule; neither accounts for all the additive contributions.
Classification: Add Scores Before Converting to Probabilities
For a binary classifier using logistic scores, the tree outputs add on the log-odds scale. If the resulting score is \(F(x)\), the probability assigned to the positive class is \(1/(1+\exp(-F(x)))\). This transformation is applied to the combined score, not separately to each tree output. Other classification methods may use different score scales and transformations, so the model specification must identify the scale before calculating a probability.
Worked Example: Turning an Additive Score Into a Class Probability
A hypothetical binary classifier uses a logistic score. Its initial score is \(F_0=-0.4\), and \(\eta=0.5\). For one applicant, three trees return \(+1.2\), \(+0.8\), and \(-0.4\). Calculate the final score and the probability of the positive class, to four decimal places. Using a classification threshold of 0.5, state the predicted class.
Method. Add the scaled tree outputs on the log-odds scale, then apply the logistic transformation once to the combined score.
The contributions are \(0.5(1.2)=0.6\), \(0.5(0.8)=0.4\), and \(0.5(-0.4)=-0.2\). Thus the final score is \(-0.4+0.6+0.4-0.2=0.4\).
The positive-class probability is \(1/(1+\exp(-0.4))\). Since \(\exp(-0.4)\approx0.6703\), the probability is \(1/(1+0.6703)=1/1.6703\approx0.5987\). Rounded to four decimal places, the probability is 0.5987. It exceeds 0.5, so the predicted class is positive.
The result is checked by first confirming the three scaled contributions sum to \(0.8\), which changes the initial score from \(-0.4\) to \(0.4\), and then applying the logistic transformation. A common incorrect calculation is to transform the three tree outputs separately and average those probabilities. That does not implement an additive log-odds model.
Boosting Is Not One Large Tree or an Average of Trees
A single large tree and a boosted ensemble can both produce nonlinear predictions, but their structures differ. A single tree makes its prediction from one route through one partition. A boosted model sums the outputs of multiple routes, one through each component tree. In a boosted model, a leaf value is an adjustment to the current score, not necessarily a stand-alone prediction of the response.
| Feature | One large tree | Gradient-boosted trees |
|---|---|---|
| Prediction construction | Return the value from one terminal leaf | Add the base prediction and the scaled outputs of multiple trees |
| Role of a tree leaf | Direct prediction for observations in that leaf | Contribution to the combined prediction |
| Model structure | One set of branching rules | A sequence of separate sets of branching rules |
| Combination rule | No combination across trees | Sum the tree contributions; do not generally average them |
The distinction is important when interpreting predictions. A large positive leaf value in one component does not, by itself, imply a large final prediction: the base score and every other tree contribution also matter. Likewise, a negative tree output is not an error; it can move the current prediction down.
Check Your Understanding
Work each problem by tracking the initial prediction, the tree contributions, and the scale of the final result.
- A regression model has \(F_0=20\), \(\eta=0.25\), and three tree outputs \(8\), \(-4\), and \(12\) for one observation. What is the final prediction? (Answer: 24)
- A model has \(F_0=5\) and \(\eta=0.5\). For observation A, two trees return \(-2\) and \(+6\); for observation B, they return \(+4\) and \(-2\). Find both predictions. (Answer: A = 7; B = 6)
- A logistic-score model has initial score \(-0.2\), \(\eta=0.5\), and tree outputs \(+1.2\) and \(-0.4\). Find the final score and positive-class probability to four decimal places. (Answer: score = 0.2; probability = 0.5498)
- One tree in a boosted model returns \(-3\) for an observation. Does that value alone establish that the final predicted response is negative? Explain what else is needed. (Answer: No; the initial prediction and the scaled outputs from all other trees are also needed.)
- A regression model starts at 9 and uses \(\eta=0.1\). Three tree outputs are \(-5\), \(10\), and \(0\). Calculate the final prediction and state the net change from the initial prediction. (Answer: final prediction = 9.5; net change = +0.5)