Linear models versus gradient boosting on small property data
On a few hundred molecules a short linear equation and a boosted ensemble often tie on held-out error, and the equation is easier to audit and extrapolate.
Updated November 28, 2026
On a few hundred molecules a short linear equation and a gradient-boosted ensemble often reach similar held-out error, and the equation wins on everything else. It extrapolates in a stated direction, it has two or three numbers to audit, and its failures are visible. Boosting earns its place when the data are large, the relation is not monotone in any single descriptor, and the molecules you will predict sit inside the training distribution. This guide compares what each model can represent, how each overfits, and how to run a comparison that means something.
What each model can represent
A kernel is linear in one or two transformed descriptors. Its response to a descriptor is a monotone power law, and its response to two descriptors is additive. It cannot represent an interaction, a threshold or a bump.
Gradient boosting fits a sum of small decision trees, each one correcting the residual of the sum so far. The result is a piecewise-constant surface that can represent thresholds, interactions and bumps of any shape the data support. With nine descriptors and a few hundred molecules the surface is coarse, because each leaf averages a handful of molecules, but it is not restricted to monotone or additive forms.
Outside the training range the two behave in opposite ways. A tree ensemble predicts the edge value, flat. A power-law term continues its trend, which is right when the physics is monotone and wrong when it is not. Neither behaviour is safe. The difference is that the equation's assumption is written down, while the ensemble's is implied by its structure.
How each one overfits
A kernel overfits through its search. The descriptor, the exponent and the term count are chosen from thousands of candidates, and the guide on overfitting with few parameters shows how far the best null candidate can rise. Once the form is chosen, the two coefficients are stable.
Gradient boosting overfits through its hyperparameters and its capacity. The number of trees, their depth, the learning rate, the subsampling rate and the minimum leaf size all shape the fit, and each one tuned by cross-validation adds a search of its own. On a few hundred molecules the ensemble can reproduce the training set almost exactly, so the in-sample figure is useless, and the whole judgement rests on the held-out set. In that respect it is in the same position as the kernel, with a far larger search.
Both are vulnerable to leakage. Near-duplicate molecules on both sides of a random split flatter the ensemble more, because it can memorise the duplicate, but they flatter the equation too. The guide on the scaffold split with Bemis-Murcko scaffolds explains the fix.
A comparison that means something
A comparison is fair only when both models see the same molecules, the same split and the same held-out set, and when every choice is made inside the training part. The following sketch uses grouped folds by scaffold so that no scaffold sits on both sides.
import numpy as np
from sklearn.linear_model import Ridge
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.model_selection import GroupKFold, cross_val_score
# Z: standardised power-law columns chosen on training data only
# X: the nine raw descriptors, groups: Bemis-Murcko scaffold ids
cv = GroupKFold(n_splits=5)
ridge = Ridge(alpha=1e-3)
gbr = GradientBoostingRegressor(n_estimators=300, max_depth=2,
learning_rate=0.05, subsample=0.8)
r_lin = cross_val_score(ridge, Z, y, groups=groups, cv=cv,
scoring="neg_mean_absolute_error")
r_gbr = cross_val_score(gbr, X, y, groups=groups, cv=cv,
scoring="neg_mean_absolute_error")
print(-r_lin.mean(), -r_gbr.mean())The sketch hides the hard part. The columns in Z were chosen by a search, and that search must run inside each fold for the comparison to be honest. The guide on grouped cross-validation gives the loop. Report both errors with a bootstrap interval, because two numbers that differ by 0.05 log units on sixty molecules are usually one number.
MolBasis publishes no such comparison. Its kernel pages state held-out figures against the train-mean baseline only, and no other method has been run on the same molecules. The guide on short QSPR equations versus machine learning sets out what a comparison would need.
When to choose which
Choose the equation when the dataset has a few hundred molecules or fewer, when one or two descriptors carry the physics, when you need to explain or audit a prediction, or when the molecules you care about lie at the edge of the training range. Choose it also when the result must be checked by hand by a reviewer.
Choose boosting when the dataset has thousands of molecules, when a short equation plateaus well short of the noise level, when thresholds or interactions are plausible, and when every prediction will fall inside the training distribution. Choose it with a learned representation such as Chemprop only when the data are large enough to learn one, which a few hundred molecules are not.
Choose neither alone when the property depends on something a single molecule cannot determine. Melting point depends on crystal packing, and no model of the isolated molecule, linear or not, carries that information. The guide on when a short equation is enough draws that line.
Key points
- A kernel is monotone and additive in one or two transformed descriptors. Boosting can represent thresholds and interactions but is flat outside the training range.
- Both overfit through search. The kernel searches its form once. Boosting searches its hyperparameters and can memorise a small training set.
- A fair comparison uses the same molecules, a scaffold-blind or grouped split, selection inside the folds, and bootstrap intervals.
- With a few hundred molecules, prefer the equation for auditability and extrapolation. With thousands and plausible interactions, boosting earns its place.
Questions people ask
- Does gradient boosting beat a linear equation on small QSPR datasets?
- Not reliably. With a few hundred molecules and a handful of descriptors the two often land within each other's bootstrap interval on a scaffold split. Boosting pulls ahead when data are plentiful and the relation is not monotone in any one descriptor.
- Why can a tree ensemble not extrapolate?
- Each tree predicts the mean of the training molecules in a leaf, so outside the training range the prediction is flat at the edge value. A power-law term continues its trend, which can be right or wrong but is at least a stated assumption.
- How should I compare the two fairly?
- Use the same molecules, the same scaffold-blind or grouped split, and tune the boosting hyperparameters inside the training folds only. Report both with a bootstrap interval and a calibration slope.
Further reading
In practice: A kernel on this site is one or two descriptor terms with coefficients from a single ridge solve. The methodology page gives the exact form, the grid and the gate the search had to pass.
See the kernels themselves
Every kernel is shown with its held-out result, the number of molecules it rests on and what it cannot be trusted for.