42 Trees & Ensembles
← Back to: Classical ML Overview
42.1 Decision trees
A tree recursively partitions the data, choosing at each node the split that most reduces impurity — Gini or entropy for classification, variance for regression:
\[ \text{Gini}(S) = 1 - \sum_c p_c^2. \]
Trees are interpretable (a path is a rule list), handle mixed feature types natively, and need no scaling. Their weakness is variance: a deep tree memorizes the training set and a small data change reshapes it entirely. The two ensemble families below both exist to tame that variance.
42.3 Gradient boosting: sequential residual fitting
Boosting builds the ensemble additively: each new tree fits the gradient of the loss left over by the current model:
\[ F_m(x) = F_{m-1}(x) + \nu\, h_m(x), \qquad h_m \approx -\nabla_F \mathcal{L}\big(y, F_{m-1}(x)\big), \]
with learning rate \(\nu\). This is gradient descent in function space — the same optimization logic as neural training, but the “step” is a small tree rather than a parameter update. XGBoost/LightGBM add regularization, second-order information, and engineering that make them the production tabular workhorse.
42.4 Timeline context
This is the honest counterweight to the deep-learning narrative: on tabular, heterogeneous, structured data — most of enterprise ML — gradient-boosted trees still beat neural nets in accuracy, training cost, and ease of tuning. Deep learning won perception and language; trees still own the spreadsheet.
← Back to: Classical ML Overview