Feature selection by search and the optimism it creates
Choosing the best descriptor from several makes its score optimistic, the winner's curse. Selecting on training molecules and reporting on others removes it.
Updated November 28, 2026
Choosing a descriptor by trying all of them and keeping the best one makes the reported score optimistic, even when every candidate is scored fairly. The effect is the winner's curse. The maximum of several noisy estimates overshoots the true value of whichever candidate wins. The remedy is to make the choice on one set of molecules and report the result on another, which is what the MolBasis protocol does with its 25 % scaffold-blind split. This guide shows the size of the bias with nine candidates, explains why ridge does not see it, and lists the three remedies.
Nine candidates with the same true correlation
Imagine nine descriptors that each have a true Pearson r of 0.30 with the property. On a sample of a few dozen molecules each estimated r scatters around 0.30 with a standard deviation of about 0.15. Nothing distinguishes the descriptors. Any choice between them is a choice between noise.
The search picks the highest of the nine estimates. For nine independent draws from a normal distribution the expected maximum lies about 1.49 standard deviations above the mean, a standard table value. So the winner is expected to show r = 0.30 + 1.49 × 0.15 = 0.52.
Now take the winner to a fresh set of molecules. Its true r is still 0.30, because all nine were equal. The held-out score reverts to about 0.30. The gap of 0.22 is pure selection. No coefficient was overfitted, no leak occurred, and the drop is still large.
The following simulation reproduces the effect. It builds nine descriptors with the same true correlation, chooses the best on the first half, and scores it on the second.
import numpy as np
rng = np.random.default_rng(1)
n, k, true_r = 40, 9, 0.30
wins, holds = [], []
for _ in range(2000):
s = rng.standard_normal(2 * n)
noise = rng.standard_normal((2 * n, k))
x = true_r * s[:, None] + np.sqrt(1 - true_r ** 2) * noise
r_train = [np.corrcoef(x[:n, j], s[:n])[0, 1] for j in range(k)]
j = int(np.argmax(r_train))
wins.append(r_train[j])
holds.append(np.corrcoef(x[n:, j], s[n:])[0, 1])
print(round(np.mean(wins), 2), round(np.mean(holds), 2))The first number comes out near 0.5 and the second near 0.3.
The exponent grid multiplies the candidates
Nine descriptors is the smallest version of the problem. Each descriptor comes with a grid of exponents, so the one-term search has around 180 candidates, and the two-term search has over ten thousand. The expected maximum keeps rising with the logarithm of the candidate count. Neighbouring exponents are strongly correlated, which slows the rise, but it does not stop it. The guide on power-law terms and exponent grids shows how close adjacent exponents are.
The ridge solve inside each candidate is blind to all this. Its λ regularises coefficients given the columns. It has no term for how the columns were chosen. The guide on overfitting with few parameters makes the same point from the side of the equation's capacity.
Three remedies, and the one MolBasis uses
- Choose on training molecules, report on held-out molecules. Set aside a share of the data before any candidate is scored. Run the whole search on the rest. Refit the coefficients of the winner on the training share, then measure once on the held-out share. The held-out score has no selection bias because the held-out molecules took no part in the selection.
- Nested cross-validation. Run the search inside each training fold and score the winner on the matching test fold. The average over folds estimates the performance of the procedure, not of one equation. The guide on nested cross-validation sets out the loops.
- A permutation floor. Shuffle the property, rerun the search, record the best score, repeat. The distribution of the best null scores shows how high the winner's curse alone can lift a result. The guide on permutation tests and y-scrambling gives the details.
The MolBasis record uses all three. Its headline figure comes from the first. Twenty-five percent of unique Bemis-Murcko scaffolds are set aside with a fixed seed, the equation is selected on the remaining 75 %, the coefficients are refitted on that 75 %, and r, MAE lift and calibration slope are measured on the held-out molecules. One split, one seed, and no confidence interval in the record. The methodology page states the protocol.
The trap of selecting on everything
The most common failure is subtle. A researcher scores all candidates on the full dataset, picks the winner, and then cross-validates the winner's coefficients. The cross-validation looks clean. Every fold refits β on its training part. But the descriptor and the exponent were chosen with the test folds in view, so the selection bias is intact and the reported score carries the full winner's curse.
This is what a full-data fit means. Three two-term equations in the MolBasis record were of this kind. Their second terms had been chosen on all the data, and the figures beside them were not held-out figures. The site now shows them as one-term equations, and the findings page records the correction. The guide on full-data fits mislabelled as validated tells how the audit found them.
Cross-validating the coefficients of a feature you chose on the whole dataset validates nothing about the choice.
Key points
- The best of several equal candidates scores higher than its true value. With nine candidates and a spread of 0.15, the winner reads near 0.5 when the truth is 0.3.
- The exponent grid multiplies the candidates, and the optimism grows with their logarithm.
- Ridge does not remove the bias. Only selecting on one set and reporting on another does, or nested cross-validation, or a permutation floor.
- A full-data fit chooses the feature on all molecules and then cross-validates the coefficients. The selection bias survives intact.
Questions people ask
- Why is the best descriptor's correlation optimistic?
- Because the maximum of several noisy estimates overshoots the true value of whichever candidate wins. Even if all candidates share the same true correlation, the one that happened to score highest on this sample will score lower on the next.
- How large is the optimism from choosing among nine descriptors?
- For nine candidates with equal true correlation, the expected maximum sits about 1.5 standard deviations above that true value. With a sampling spread of 0.15 in r, the reported winner would read about 0.5 while the truth is 0.3.
- What is a full-data fit and why does it matter?
- A fit whose descriptor and exponent were chosen using every molecule, so no held-out set remained for the choice. Cross-validating only the coefficients afterwards does not remove the selection bias.
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.