LearnViz CompSci
Home / Learn / AI & Machine Learning / Gradient Boosting

Intermediate Topic 24 of 51 AI & Machine Learning

Gradient Boosting

Sequentially adding models that correct earlier errors.

How it works

Gradient boosting builds an ensemble sequentially, with each new weak learner, usually a small decision tree, trained to correct the errors of the current ensemble by fitting the negative gradient of the loss, the residuals for squared error. A learning rate shrinks each tree's contribution, and trees are added until validation performance stops improving. Implementations such as XGBoost, LightGBM and CatBoost add regularization, histogram-based splits, handling of categorical features and efficient parallel training.

Step-by-step walkthrough

  1. Start with a simple model, often a shallow tree.
  2. Compute its errors, the residuals.
  3. Train the next model to predict those errors.
  4. Add it to the ensemble with a small weight.
  5. Repeat hundreds of times, as in XGBoost and LightGBM.

Where it is used

Gradient-boosted trees are among the top performers on structured, tabular data, used in click-through prediction, credit risk, ranking, forecasting and many competition-winning solutions.

Common pitfall

They overfit if too many trees, too much depth or too high a learning rate are used, so use early stopping and tune carefully. Training is sequential and slower than random forests, and predictions are less interpretable. Noisy labels hurt. Control complexity, use subsampling and monitor validation loss.

Where it fits in the course

Gradient Boosting is topic 24 of 51 in AI & Machine Learning, rated Intermediate. It follows Random Forests. The next topic is Feature Engineering.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the AI & Machine Learning quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Gradient Boosting?
Sequentially adding models that correct earlier errors. It belongs to AI & Machine Learning and is an intermediate-level topic.
Where do people use Gradient Boosting?
Gradient-boosted trees are among the top performers on structured, tabular data, used in click-through prediction, credit risk, ranking, forecasting and many competition-winning solutions.
What is the most common mistake with Gradient Boosting?
They overfit if too many trees, too much depth or too high a learning rate are used, so use early stopping and tune carefully.
What should I learn before this topic?
Start with Random Forests, the topic just before it in AI & Machine Learning.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the AI & Machine Learning quiz.
Is Gradient Boosting hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Gradient Boosting?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Gradient Boosting?
Random Forests, Feature Engineering, Support Vector Machines are closely connected. The full list is in the related topics section of this page.
What should I study after Gradient Boosting?
Continue with Feature Engineering, the next topic in AI & Machine Learning.

Related topics