A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Gradient Boosting Machines

Graduate Depth 97 in the knowledge graph ☐ I know this ☆ Set as goal
19topics build on this
676prerequisites beneath it
See this on the map →
Advanced Ensemble MethodsGradient Descent and Optimization+2 more→→Support Vector Machines
ensemble boosting supervised-learning

Core Idea

Gradient boosting fits weak learners sequentially to residuals, focusing on remaining errors. Each learner reduces previous prediction errors. XGBoost and LightGBM are efficient implementations with regularization. Works with any differentiable loss function.

Explainer

From ensemble methods, you know that combining multiple weak models often outperforms any single strong model. From gradient descent, you know how to minimize a loss function by iteratively stepping in the direction of steepest descent. Gradient boosting unifies these ideas in an elegant way: it performs gradient descent in function space, where each step is a new weak learner (typically a small decision tree) fitted to the negative gradient of the loss. Instead of adjusting numerical parameters, gradient boosting adjusts the prediction function itself, one additive correction at a time.

Here is the concrete procedure. Start with a simple initial prediction — for regression, the mean of all target values. Compute the residuals: the differences between the true targets and current predictions. These residuals tell you exactly where and by how much the current model is wrong. Now fit a small decision tree (a "weak learner") to predict these residuals. Add this tree's predictions to the current model, scaled by a learning rate (typically 0.01–0.3). The model has now corrected some of its errors. Repeat: compute new residuals from the updated predictions, fit another tree to those residuals, add it in. After hundreds or thousands of such iterations, the ensemble of small trees collectively produces highly accurate predictions. Each tree is simple (often just 4–8 terminal nodes), but their cumulative effect is powerful.

The connection to gradient descent becomes clear when you generalize beyond squared-error loss. For squared error, the residual (y − ŷ) happens to equal the negative gradient of the loss with respect to the prediction. For other loss functions — absolute error, log-loss for classification, quantile loss for prediction intervals — the residuals are replaced by the negative gradient of the loss function evaluated at each data point's current prediction. The new tree is always fitted to these pseudo-residuals. This is why the method is called gradient boosting: it performs gradient descent in function space, and the "gradient" is computed pointwise across the dataset. This generality means gradient boosting works with any differentiable loss function, making it applicable to regression, classification, ranking, and survival analysis.

The practical dominance of gradient boosting in applied machine learning (especially on tabular data) comes from implementations like XGBoost, LightGBM, and CatBoost that add critical engineering and regularization. XGBoost introduced second-order Taylor expansion of the loss (using both gradient and Hessian) for better split finding, plus L1 and L2 regularization on leaf weights to prevent overfitting. LightGBM made training dramatically faster with histogram-based splitting and leaf-wise tree growth instead of level-wise. Key hyperparameters to tune are learning rate (smaller = more trees needed but better generalization), tree depth (deeper = more complex interactions captured), and number of trees (controlled by early stopping on a validation set). The learning rate and number of trees trade off directly: halving the learning rate roughly doubles the number of trees needed, but often improves final accuracy. Gradient boosting remains the default choice for structured/tabular prediction tasks, consistently winning Kaggle competitions and powering production ML systems across industry.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Linear Regression in Machine Learning → Neural Network Fundamentals → Backpropagation Algorithm → Multilayer Perceptrons (MLPs) → Activation Functions in Neural Networks → Vanishing Gradient Problem → Gradient Descent and Optimization → Gradient Boosting Machines

Longest path: 98 steps · 676 total prerequisite topics

Prerequisites (4)

Leads To (1)