After the example’s update, four observations have weight 1/6 and two have weight 1/3. Their total is 4/3. Dividing by this total gives weights 1/8 for each correct observation and 1/4 for each incorrect observation. The two mistakes now carry half the total weight.
Only relative weights matter when the next weighted error divides by their sum. Under normalization, correctly classified observations lose relative weight even though their unnormalized weights were unchanged.
For 0<errm<1/2, the learner gets a positive vote. At 1/2 its vote is zero. A zero error requires a stopping rule because the log ratio diverges. Repeatedly upweighting mistakes can also focus on mislabeled observations; boosting does not automatically distinguish label noise from a difficult but useful case.
A boosting algorithm that uses deviance (log likelihood) as the loss function instead of the exponential loss used in AdaBoost. Outputs a probability between 0,1 instead of class labels as in AdaBoost.
Forward stagewise algoirthm requires an estimate fm−1(xi).
Loss function used is the deviance (negative binomial likelihood).
Assuming that trees (b(xi;γm)) are being used as weak learners,
Initialize f0
Fir m1 to M:
a. Compute pseudo residuals.
b. Fit a regression tree (with J terminal nodes) to pseudo residuals.
c. For each terminal node, compute fitted values.
d. Update fm=fm−1+ fitted values.
Output fm as estimate of f.
Loss function is minimized by going in the opposite direction of the gradient.
With half-squared error, L=(y−f)2/2, this is the ordinary residual y−f. With binary log loss and f measured in log-odds, it is y−p. The new tree is a regression tree fitted to these numerical residuals even when the original target is a class label.
The example uses residuals to choose regions, then a Newton approximation for each region’s update:
This combines the first derivative with the curvature of the loss. Classical LogitBoost uses a weighted least-squares Newton procedure; the residual-tree construction here describes gradient tree boosting with Newton leaf updates.
A smaller η takes smaller steps and generally needs more trees. Tune the learning rate, tree size, and number of rounds together. Early stopping selects the number of rounds using validation loss. The test set should not decide when to stop.
Usage
Data with nonlinear relationships.
Mixed type features.
Can fit difficult observations, but response outliers and label noise need care, especially with AdaBoost.
Need to look at the feature importance.
Limitations
Not quite interpretable
Data is extremely high-dimensional and sparse.
When a fast prediction is wanted.
Boosted-tree prediction can be slow because it evaluates many trees.
Time series and ordered data without careful splitting.
A way to approximate a function using a polynomial built from the function’s derivates at a point.
If f is analytic and x lies within the convergence interval, then f(x)=∑n=0∞n!f(n)(a)(x−a)n.
A finite-order Taylor approximation needs suitable derivatives and a remainder term; infinitely many derivatives alone do not guarantee that the infinite series equals the function.
This approximates the loss for one observation. Sum over observations and add the regularization terms to obtain the objective.
Symbol
Meaning
gi
First derivative of the loss function with respect tofm−1(xi).
hi
Second derivatives.
current loss (constant)i=1∑nl(yi,fm−1(xi))+Taylor expansion of lossi=1∑nγimgi+0.5i=1∑nhiγim2+L2 regularization on leaf weights0.5νj=1∑Tγjm2+penalty on number of leavesαT
The factor 1/2 follows from the objective written above. Omitting it requires rescaling the complexity penalty as well. The leaf penalty does not change the ranking of candidate splits that all add one leaf, but it does change whether a split is worth keeping.
For half-squared loss, gi=fi−yi and hi=1, giving the residual formula above. For binary log loss on a log-odds score, gi=pi−yi and hi=pi(1−pi). The residual-count formula cannot be reused unchanged for binary classification.
α does not affect finding out wich split has the highest gain.
Build a tree until some stopping criteria has been reached (e.g., maximum depth), and then prune all leaves from the bottom that have a negative α-adjusted gain.
This is equivalent to pruning all leaves with a gain less than a threshold α; a raw gain below α is rejected; an already penalty-adjusted gain is compared with 0.
To determine the best split for a given tree, we need to check every threhold for every variable. (e.g., If 1000 observations, 999 potential splits). This takes a long time. Instead, consider for each variable only quantiles.
If there is a missing value, find the split on that x-variable as usual on non-missing values.
Evaluate gain in two options: Add missing values (with non-missing y) to the left or the right child node.
Add missing values to the option leading to the greater gain.
This is mentioned as sparsity awareness.
Usage
When do we use XGBoost, not standard boosting?
Large dataset: XGBoost is parallelized and cache-optimized.
Built-in regularization
Missing data: XGBoost handles missing values automatically by learning the best default direction at each split.
Better optimization: Second-order information can give better-scaled updates; it does not guarantee faster convergence or better prediction in every problem.
Sparse Data: XGBoost has a sparsity-aware algorithm that efficiently handles sparse feature matrices like TF-IDF vectors.
Limitations
When do we NOT use XGBoost, not standard boosting?