Skip to content

Gradient Boosting

For people

How gradient boosting builds trees that correct each other's mistakes, and why it dominates tabular machine learning.

Editorial team 2 min read

Gradient boosting builds an ensemble of small decision trees one after another, each new tree correcting the errors of those before it.

How It Works

  1. Start with a simple prediction, such as the average target value.
  2. Compute the errors (more precisely, the gradient of the loss) on the training data.
  3. Fit a small tree to predict those errors.
  4. Add the tree's predictions, scaled by a learning rate, to the model.
  5. Repeat for hundreds or thousands of rounds.

Because each tree focuses on what the ensemble still gets wrong, the model steadily improves.

  • XGBoost, LightGBM and CatBoost — fast, well-engineered libraries widely used in industry and competitions.
  • scikit-learn's HistGradientBoostingClassifier and …Regressor — a fast built-in option.

Key Hyperparameters

  • Learning rate — smaller values need more trees but generalise better.
  • Number of trees — use early stopping on a validation set to choose.
  • Tree depth / number of leaves — controls complexity.
  • Subsampling of rows and columns — adds randomness that reduces overfitting.

Strengths and Weaknesses

Gradient boosting is usually the most accurate choice for structured, tabular data and handles missing values and mixed feature types well. It needs more careful tuning than a random forest and can overfit if trained too long.

Tip

Always use early stopping against a validation set rather than guessing the number of trees.

More in Machine learning

All Machine learning guides →
Machine learning Guide · 2 min

Linear Regression Explained

The simplest predictive model: how linear regression fits a line through data, how to read its coefficients, and when it breaks down.

Machine learning 2 min read 18 Sep 2026 For people

Machine learning Guide · 2 min

Logistic Regression for Classification

Despite its name, logistic regression is a classification method. How it produces probabilities and why it remains a strong baseline.

Machine learning 2 min read 17 Sep 2026 For people

Machine learning Guide · 2 min

Decision Trees

How decision trees split data with simple questions, why they are easy to explain, and why single trees overfit.

Machine learning 2 min read 16 Sep 2026 For people

Machine learning Guide · 2 min

Random Forests

Why averaging many randomised decision trees produces a robust, accurate model with little tuning.

Machine learning 2 min read 15 Sep 2026 For people

Share X LinkedIn Reddit Bluesky Email

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in