Tree pruning removes branches that fail a specified split-quality condition. In XGBoost, it helps prevent overfitting: a split is kept only when its similarity gain exceeds the minimum split-loss threshold. section 12.5
Pruning by similarity gain
For an example tree, only splits with similarity gain higher than 1 are allowed. One split fails that condition, so removing it produces the pruned tree used as a weak learner. section 12.5
Figure 12.24 On the left, we have the same tree from figure 12.23, with an extra piece of information: the similarity gain. We obtain this by subtracting the similarity score for each node from the combined similarity score of the leaves. We only allow splits with a similarity gain higher than 1 (our minimum split loss hyperparameter), so one of the splits is no longer permitted. This results in the pruned tree on the right, which now becomes our weak learner.
Compare the candidate tree and its similarity gains with the resulting pruned tree. section 12.5
