QSPR for data scientists arriving from other domains
QSPR looks like tabular regression, but the split, the near-duplicates and the feature search behave differently when the rows are molecules.
Updated November 28, 2026
Three decisions in a QSPR project change the reported number more than the choice of algorithm. How you split the data. Whether you count the feature search as part of the model. Which metric you report and whether it is stable. A data scientist from another domain has the skills for all three. The molecules change what the right answer is, and this primer explains how.
The rows are molecules and that breaks the random split
Your rows are caffeine, aspirin, ethanol, glucose and a few thousand others, each as a SMILES string. Your target is a measured property such as aqueous solubility, melting point or logP. The dataset looks like any regression table. It is not, because the rows are not independent draws.
Chemists make molecules in series. Ethanol, propanol, butanol, pentanol and hexanol differ by one CH2 each and their properties move smoothly. Medicinal chemistry programmes make dozens of analogues around one ring system. A random split puts butanol in the test set with propanol and pentanol in training, and the model interpolates. The test score then measures interpolation inside a series, not prediction of a new chemotype. The guide on random splits and leakage shows how large the inflation can be.
The remedy is a grouped split. The standard grouping is the Bemis-Murcko scaffold, which strips side chains and keeps ring systems and the linkers between them. Molecules sharing a scaffold stay on one side. Here is the split used on this site, written with RDKit and scikit-learn.
from rdkit import Chem
from rdkit.Chem.Scaffolds import MurckoScaffold
from sklearn.model_selection import GroupShuffleSplit
def scaffold(smiles):
mol = Chem.MolFromSmiles(smiles)
return MurckoScaffold.MurckoScaffoldSmiles(mol=mol)
groups = [scaffold(s) for s in smiles_list]
splitter = GroupShuffleSplit(n_splits=1, test_size=0.25, random_state=2026)
train_idx, test_idx = next(splitter.split(X, y, groups=groups))Note that test_size is a fraction of groups, not of rows. Acyclic molecules all share the empty scaffold and form one large group. A quarter of the scaffolds can be far fewer than a quarter of the molecules, and that is why held-out sets here can be small. The guide on the scaffold split step by step covers the edge cases. Time splits, where available, are harsher still and closer to how a model is used in practice.
The search is the model
A property kernel on this site is one or two terms. Each term is a descriptor raised to a power, with the exponent taken from a grid in steps of 0.25, then z-scored. The coefficients come from a single ridge solve. Two or three coefficients looks like a model that cannot overfit.
It can, because the descriptor and the exponent were chosen by search. Nine descriptors times a grid of exponents, taken one or two at a time, is hundreds of candidate equations. The one with the best training score wins. Its score is optimistic for the same reason a hyperparameter grid search is optimistic when scored on the validation fold it was tuned on. The guide on overfitting with few parameters makes the argument in full.
The remedy you already know is nested cross-validation. The remedy you may not know is the permutation floor. Shuffle the target, rerun the entire search, record the best score, repeat. The winner on real data must clear the 95th percentile of those noise winners by a margin. The methodology page describes this gate and the others, including grouped leave-one-out, bootstrap intervals and a plateau count of equations within 0.01 r of the best. A plateau of ten near-equivalent equations means the single winner is a fiction.
Metrics, and which one survives a small test set
Pearson r is the most quoted QSPR metric and the most forgiving. It ignores a constant offset and a wrong slope. A model that predicts half the true range with the right ordering gets a high r and a calibration slope near 0.5. The calibration slope should sit beside r in any report.
MAE in the property's own units is the number a chemist can use. Quote it against the baseline that predicts the training mean for every molecule. On this site, a kernel passes the lift gate when it cuts MAE by at least 30 percent against that baseline on the held-out split. On a held-out set of a few dozen molecules, one outlier moves MAE by a tenth of a log unit and moves r by several hundredths. Bootstrap the held-out set and report the interval. The record behind this site reports one split with one seed and no interval, and says so.
What the molecular features cost and what they are
In most domains features are free. Here the nine descriptors each kernel uses come from one DFT calculation per molecule, run on a single force-field conformer in a water-like continuum. That is minutes per molecule, not microseconds. Fingerprints and RDKit descriptors are the cheap alternative.
The descriptor files carry two traps a data scientist will not expect. Units can be wrong under a right-looking field name, and the findings page records cavity areas stored in bohr² under a name that says Ų. And a descriptor can be silently zero through a code path error, as happened with the hydrogen-bond donor surface. Run the checks in the mfsig guide on units and unit errors before any fit, and read sigma profiles in machine learning for how surface-charge descriptors enter a model. The files themselves come from mfsig, and the site's docs page lists each field and its unit.
A short equation gives you an interpretable baseline that a gradient-boosted model must beat on the same scaffold split, and often does not on a few hundred rows. The guide on linear models versus gradient boosting sets out when each wins. What the short equation cannot give you is a general predictor. It is fitted on one dataset, selected by one search and reported on one split. Each kernel page states its held-out r and the number of molecules that figure rests on, without coefficients and without external validation.
Key points
- Split by scaffold, not at random. Near-duplicates make a random split measure interpolation.
- A quarter of scaffolds is not a quarter of molecules, so held-out sets can be small and figures unstable.
- Count the descriptor and exponent search as part of the model and test it with a permutation floor and nested cross-validation.
- Report MAE against the train-mean baseline and the calibration slope beside Pearson r.
- Check descriptor units and zero columns before fitting. The features are expensive and the files have known traps.
Questions people ask
- Why is a random train-test split misleading for molecules?
- Property datasets are full of near-duplicates, such as homologous series and single-atom substitutions. A random split puts butanol in the test set and propanol and pentanol in the training set, so the model interpolates. A scaffold split groups molecules by their Bemis-Murcko ring framework and keeps every member of a group on one side.
- What is a scaffold split?
- A scaffold split assigns each molecule to its Bemis-Murcko scaffold, the ring systems plus the linkers between them with side chains removed, then holds out whole scaffolds. On this site 25 percent of the unique scaffolds are held out before fitting. That is a share of scaffolds, not of molecules, so held-out sets can be small.
- Is a two-parameter equation safe from overfitting?
- No. The equation has few coefficients, but choosing which descriptor and which exponent to use is a search over many candidates. The selected winner is optimistic by construction. A permutation test that shuffles the target and reruns the whole search gives the noise floor that the winner must clear.
- Should I report Pearson r or R squared?
- They answer different questions. Pearson r measures how well predictions correlate with observations and ignores a constant offset or a wrong slope. R squared on a held-out set measures the fraction of variance explained relative to the mean and can be negative. Report MAE and the calibration slope alongside either.
Further reading
In practice: Start from the kernel catalogue for the property you need and read its known limits before its correlation. For a molecule's descriptors, the file comes from mfsig; for mixtures and formulation, MolForge's platform continues the work.
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.