Back to Supervised Learning

Gradient Boosting — XGBoost, LightGBM, CatBoost

The current dominant family for tabular ML. The intuition behind GBM and why the three libraries exist. FIND_VIDEO: search 'gradient boosting xgboost lightgbm explained' — recommended channel: StatQuest / 3Blue1Brown. Aim for 12 min or under.

16 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.

Ready to continue?

Mark this lesson as complete when you're ready to proceed.

Key moments

  1. Lesson ContextThe lesson introduces Gradient Boost for regression, assuming knowledge of Decision Trees and AdaBoost.
  2. AdaBoost vs Gradient Boost StartThe comparison shows AdaBoost starts with a stump while Gradient Boost starts with a single leaf.
  3. Initial PredictionGradient Boost’s initial prediction is the average value of the continuous variable being predicted.
  4. Calculate Pseudo ResidualsPseudo residuals are calculated as the difference between the observed values and the initial average prediction.
  5. Tree Predicts ResidualsA decision tree is built using the features to predict the calculated pseudo residuals.
  6. Apply Learning RateA learning rate scales the new tree's contribution to prevent overfitting and reduce variance.
  7. New Residuals CalculatedNew pseudo residuals are calculated based on the updated prediction, showing a small step in the right direction.
  8. Iterative ImprovementSubsequent trees are built to predict the new residuals, scaled by the learning rate, and added to the model.
  9. Final Prediction SummaryThe final prediction is the sum of the initial leaf and all subsequent scaled trees.
PDF notes

Frequently asked questions

Why is the difference called a "pseudo residual"?

It reminds us that we are using Gradient Boost, not standard linear regression, where the term residual originates.

Why does Gradient Boost build trees to predict residuals instead of the original weight?

By predicting the error (residual), the new tree takes a step toward correcting the previous prediction's mistake.

What is the benefit of using a small learning rate?

Taking lots of small steps in the right direction results in better predictions and lower variance on testing data.

How does Gradient Boost stop building trees?

It stops when it reaches the maximum number of trees specified or when additional trees fail to significantly reduce the residuals.