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.
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
- What Machine Learning Classification Is, and Where It Fits in SEO, covering decision trees, random forests and SEO performance prediction
- Complete Guide to Understanding ML Classification for Marketers: Use Cases and Model Choices
- Synthetic vs User Query Classification Notebook, which trains a tree ensemble (random forest) on labelled queries
- Introduction to Machine Learning for SEO
Where Gradient Boosting (XGBoost) shows up on MLforSEO
Sources and further reading
Other terms from ML Models & Algorithms
- BERT (Bidirectional Encoder Representations from Transformers)Google's 2018 transformer language model that reads text in both directions to produce context-aware embedding…
- BERTopicA modular topic modelling technique that clusters transformer embeddings and labels each cluster with class-ba…
- BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies)BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies) clusters very large numeric datasets by s…
- BM25A classic ranking function that scores documents by how often query words appear, adjusted for word rarity and…
- Boyer-MooreA fast exact string-search algorithm that compares a pattern from right to left and skips ahead after mismatch…
- c-TF-IDFClass-based TF-IDF: treats each cluster as one document to find the words that best describe it, used by BERTo…
- Centroid-based ClusteringA clustering family that groups data around central points (centroids), each the average of its cluster's memb…
- Convolutional Neural Network (CNN)A deep learning architecture that scans data with small learned filters to detect local patterns; the classic…
- DBSCANDensity-based clustering that groups closely packed points, finds the number of clusters itself and labels iso…