Skip to content

ML Models & Algorithms

Gradient Boosting (XGBoost)

In shortGradient boosting builds a model from many small decision trees, each fixing the errors of the last. XGBoost is the best-known library for it.

Updated 25 Oct 2026· 3 min read

Gradient boosting is a supervised learning technique that builds one strong model out of many small decision trees, each new tree trained to correct the errors left by the trees before it. XGBoost (short for eXtreme Gradient Boosting) is the best-known open-source library for it, introduced by Tianqi Chen and Carlos Guestrin in a 2016 paper. It handles both classification and regression and is a common first choice for tabular data such as analytics exports, CRM records and crawl data.

How it works

A single decision tree is easy to read but tends to be either too simple or overfitted. Ensembles combine many trees. A random forest grows its trees independently on random samples and takes the most common answer. Boosting grows them in sequence:

  • Start with a simple prediction for every row, such as the average value.
  • Measure how wrong it is for each row (the gradient of the loss function, which for simple cases is just the residual error).
  • Fit a small tree that predicts those errors and add it to the model, scaled down by a learning rate.
  • Repeat for hundreds or thousands of rounds, stopping when performance on validation data stops improving.

The XGBoost paper describes what made the library fast and robust: a regularised objective that penalises overly complex trees, built-in handling of missing values (sparsity-aware split finding) and engineering for parallel and distributed training. Similar libraries include LightGBM, CatBoost and scikit-learn’s HistGradientBoostingClassifier and HistGradientBoostingRegressor.

How it’s used in SEO and marketing

  • Predictive lead scoring and churn prediction: estimating the probability that a lead converts or a customer leaves from behavioural and firmographic features.
  • Ranking-factor and performance studies: predicting whether a page reaches the top ten from features such as content length, title structure, search volume and competitor data. Our classification material describes this task with a random forest; gradient boosting is the usual next model to try, with feature importance or SHAP values showing which inputs the model relied on.
  • Customer lifetime value and demand prediction on tabular data, with lagged values added as features for time.
  • Learning to rank: XGBoost has ranking objectives for ordering search results or recommendations.

Example

A SaaS marketing team has a table of past trial sign-ups: pages viewed, source channel, company size, emails opened, and whether each trial converted. They hold back a test set, train an XGBoost classifier on the rest, choose tree depth and learning rate with cross-validation (hyperparameter tuning), and compare it with a logistic regression baseline on the held-out rows. If it wins, sales gets a daily score for each new trial, and the feature importance chart shows marketing which behaviours separate converting trials from the rest.

Limitations and things to watch

  • It has many settings (number of trees, depth, learning rate, subsampling). Poor choices overfit quickly, so use early stopping and a proper validation set.
  • It is less transparent than a single tree or logistic regression, and feature importance can mislead when inputs are correlated.
  • Ranking-factor models find patterns in your sample, not Google’s algorithm. A feature that predicts top-ten positions may simply be a proxy for site strength.
  • Text and images must be turned into features first (TF-IDF, embeddings). On raw unstructured data, deep learning models usually do better.
  • On small datasets it often adds little over simpler models, so always keep a baseline.

Learn it on MLforSEO

Where Gradient Boosting (XGBoost) shows up on MLforSEO

Sources and further reading

Other terms from ML Models & Algorithms

See all 55 ML Models & Algorithms terms →