A QSAR model reports a number, usually R² or RMSE, and that number is treated as a verdict. It is not. It is the result of a procedure, and a different procedure on the same data can give a very different answer. Most published QSAR models that fail in someone else's hands fail not because the algorithm was wrong but because the validation asked an easier question than the one the reader assumed. This guide looks at the three places where that happens: how you split the data, how information leaks between splits, and how far the model's claims extend.
What validation is supposed to answer
There are two different questions a QSAR model can be asked. The first is interpolation: given a new compound from the same chemical series, how well can the model predict it? The second is extrapolation: given a compound from a new scaffold or a different part of chemical space, how well does it work? Both are legitimate, but they need different tests and they give different numbers. A model that is excellent at the first and poor at the second may still be useful for optimising a series. It is not useful for screening a diverse library.
State which question you are answering before you choose a validation scheme. The OECD principles and the basic curation steps are summarised in QSAR model validation; this article goes deeper on splits, leakage and domain definition. If your project also uses structure-based methods, docking has its own validation rules, covered in the molecular docking guide.
Splits decide the question
The train/test split is the most consequential decision in the whole workflow, and it is often made in one line of code without comment.
Random split. Compounds are assigned to training or test at random. Because medicinal-chemistry datasets are built from series of close analogues, a random split usually puts a near-identical sibling of each test compound in the training set. The model interpolates and the score looks strong. This is a valid estimate only for the interpolation question.
Scaffold split. Compounds are grouped by their Bemis–Murcko scaffold, and entire scaffolds are held out. This asks whether the model can predict a new core with familiar substituents. It is stricter than random and closer to what a chemist means by "new series".
Cluster split. Compounds are clustered by fingerprint similarity, and whole clusters are held out. This asks the hardest and most realistic question for virtual screening: can the model predict chemistry it has not seen? The gap between random and cluster performance is informative in itself.
Temporal split. Training compounds are older than test compounds. This mimics how a model would have performed if it had been built at a past date and used going forward. It is useful when the dataset has reliable dates, but it can confound time with changes in assay protocol.
If you report only one split, report the one that matches the claim you are making. If you can, report random and cluster side by side so the reader can see how much the model depends on close analogues.
Leakage: the quiet failure
Leakage means information from the test set reaches the model during training or selection. It inflates every metric and is usually invisible in the final report.
Common forms:
- Duplicate and near-duplicate compounds split across sets. The same molecule, a salt form, a stereo-variant or a close analogue appears in both training and test. Deduplicate on a canonical structure and consider grouping by similarity before splitting.
- Feature selection on the full dataset. Choosing descriptors using all compounds, then splitting, lets test-set information influence which features exist. Select inside each training fold.
- Scaling and imputation on the full dataset. Means, standard deviations and missing-value models computed on everything leak test information. Fit them on training data only.
- Tuning on the test set. Trying many hyperparameters and reporting the highest test score turns the test set into a validation set. Use nested cross-validation or a separate held-out set.
- Repeated use of a public benchmark. If everyone tunes on the same external set, that set stops being external.
- Metadata features. Assay date, plate, instrument or lab can encode the answer when compounds were tested in batches. These features can produce impressive but meaningless performance.
Activity cliffs deserve a separate mention. Two compounds that differ by one atom can have very different activities. A model trained on one may confidently mispredict the other, and a random split will scatter cliff pairs across training and test. If your dataset has many cliffs, report performance on them or at least acknowledge the limitation.
Negative controls
A validation without a negative control is a claim without a check. The standard control in QSAR is Y-randomisation: shuffle the activity values, retrain with exactly the same pipeline, and repeat. The shuffled models should perform near zero. If they do not, the procedure is finding structure in noise, usually through leakage or an over-flexible model on a small dataset.
Two other controls are cheap and worth reporting. First, a baseline that predicts the training mean for every compound. Second, a nearest-neighbour baseline that predicts each test compound from its most similar training compound. A complex model that barely beats nearest-neighbour similarity has learned little beyond similarity, and the reader should know that.
The applicability domain
A model's training set defines a region of chemical space. Predictions inside that region are interpolations; predictions outside are extrapolations. The applicability domain is a way of marking the boundary.
A practical definition is maximum Tanimoto similarity to the training set, computed with Morgan fingerprints. Set a threshold, flag predictions below it, and then check that the flag is meaningful: error should be lower inside the domain than outside. If it is not, the domain definition is not doing its job.
Other options include descriptor-range limits, distance to the training centroid in descriptor space, and variance across an ensemble of models. Whatever you choose, report the definition, the threshold and the evidence that it separates reliable from unreliable predictions. A domain flag without that evidence is decoration.
Metrics that match the claim
For regression, report R² or Q² on held-out data together with an error in the units of the endpoint. If the endpoint is pIC50, an RMSE of 0.7 means typical errors of about five-fold in IC50. That is far more useful to a chemist than R² alone, because it says what the model is good for.
For classification, accuracy is misleading when classes are imbalanced. Report the class balance, ROC AUC, balanced accuracy or the Matthews correlation coefficient, and the confusion matrix. If the model will be used to prioritise compounds, precision at a chosen cutoff may matter more than any threshold-free metric.
Report uncertainty. A single number from a single split is fragile. Cross-validation gives a distribution, and repeated splits give a sense of how much the score moves. If a strong result comes from one lucky split, say so or show the variation.
Write it down so someone can check
Validation is only checkable if the procedure is documented. Record the dataset version and curation steps, the split assignment, the random seeds, the descriptor or fingerprint settings, the model and hyperparameters, and the code. A short model card covering the endpoint, training data, validation scheme, applicability domain and limitations makes the model reusable and honest.
The same habits that make an analysis reproducible make a model auditable; reproducible analysis for small labs covers the practical side.
Key points
- Validation answers a specific question; random and cluster splits answer different ones.
- Deduplicate and group by similarity before splitting, or close analogues will leak across sets.
- Fit feature selection, scaling and imputation inside training folds only.
- Use Y-randomisation and simple baselines as negative controls.
- Define the applicability domain and show that error is lower inside it.
- Report errors in endpoint units, class balance for classifiers, and variation across splits.
- Document data, splits, seeds, parameters and code so the result can be checked.
When to ask for help
If you need a QSAR model that will survive review, we can curate the dataset, run scaffold and cluster validation, test the applicability domain and deliver a model card with the code. You can order an analysis or read about our QSAR and cheminformatics service. For the broader context of ADMET endpoints, see ADMET prediction: what the models are and where they fail.
Sources
- OECD Guidance Document on the Validation of (Q)SAR Models
- Best Practices for QSAR Model Development, Validation, and Exploitation
- scikit-learn: Cross-validation: evaluating estimator performance
- RDKit documentation
Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.