MolBasis
small-test-setconfidence-intervalfisher-transformationheld-out5 min read

Small test sets and unstable figures in property prediction

On eight held-out molecules, a Pearson r of 0.80 spans about 0.22 to 0.96. One molecule can flip r from −1 to 0.99. Read the molecule count before the figure.

Updated November 28, 2026

A held-out figure on a small set describes the draw of molecules as much as the model. On eight molecules, a Pearson r of 0.80 carries a 95 percent interval from about 0.22 to 0.96. On five molecules, adding or removing one point can move r from −1 to 0.99. The MolBasis protocol holds out 25 percent of scaffolds, which can mean few molecules, and each kernel page states the count. This guide shows how to turn that count into the width of the figure's uncertainty, with the arithmetic.

The Fisher transformation in three lines

Pearson r is bounded and its sampling distribution is skewed, so a normal interval around r is wrong. Fisher's transformation z = atanh(r), half the natural log of 1 plus r over 1 minus r, has an approximately normal distribution with standard error 1 / √(n−3), where n is the number of molecules. Build the interval in z and transform back with tanh.

For r = 0.80, z = 0.5 × ln(1.8/0.2) = 0.5 × ln 9 = 0.5 × 2.197 = 1.099. With n = 8, the standard error is 1 / √5 = 0.447, and the 95 percent interval in z is 1.099 ± 1.96 × 0.447 = 1.099 ± 0.877, from 0.222 to 1.976. Transform back. tanh(0.222) = 0.22 and tanh(1.976) = 0.96. An r of 0.80 on eight molecules is consistent with anything from 0.22 to 0.96.

Repeat for n = 30. The standard error is 1 / √27 = 0.192, the half-width is 0.377, and the z interval is 0.722 to 1.476, which transforms to 0.62 to 0.90. For n = 100 the standard error is 1 / √97 = 0.102, the half-width 0.199, the z interval 0.900 to 1.298, and the r interval 0.72 to 0.86. Only at a hundred molecules does the second decimal of r begin to mean something.

import numpy as np
def r_interval(r, n, z=1.96):
    fz = np.arctanh(r)
    se = 1 / np.sqrt(n - 3)
    return np.tanh(fz - z * se), np.tanh(fz + z * se)
for n in (8, 30, 100):
    print(n, [round(v, 2) for v in r_interval(0.80, n)])

One molecule decides r on five

Take five molecules with measured values 1.0, 1.2, 0.9, 1.1 and 5.0 and predictions 1.1, 0.9, 1.2, 1.0 and 4.0. Remove the fifth molecule first. The four remaining measured values have mean 1.05 and deviations −0.05, 0.15, −0.15, 0.05. The four predictions also have mean 1.05 and deviations 0.05, −0.15, 0.15, −0.05. Every product of deviations is negative, summing to −0.05, and both sums of squares are 0.05. r = −0.05 / 0.05 = −1. On the four clustered molecules the model gets the ordering exactly backwards.

Put the fifth molecule back. The measured mean becomes 9.2 / 5 = 1.84 and the predicted mean 8.2 / 5 = 1.64. The fifth molecule's deviations are 3.16 and 2.36, with a product of 7.46. The other four products are now 0.45, 0.47, 0.41 and 0.47, all positive because every clustered point is below both means. The sum of products is 9.27. The sums of squares are 12.53 and 7.01, their product 87.87, its root 9.37. r = 9.27 / 9.37 = 0.99.

The same model, the same four molecules, and r moves from −1 to 0.99 because of one compound that sits far from the rest. A held-out r on five molecules is a statement about which five. The same arithmetic makes the calibration slope and the MAE lift unstable, and the guide on bootstrap confidence intervals shows that an MAE on eight molecules spans a factor of three.

Why scaffold-blind held-out sets are often small

The MolBasis methodology sets aside 25 percent of unique Bemis-Murcko scaffolds, with one seed, before fitting. The share is of scaffolds, not of molecules. A dataset of 40 molecules on 16 scaffolds yields 4 held-out scaffolds, and if those are singletons the held-out set has 4 molecules. The guide on the scaffold split works through the same arithmetic on a larger example. The record holds one split and no confidence interval for the held-out figures. Each kernel page states the number of molecules its figures rest on, and that number is the reader's substitute for an interval.

A small held-out set is not a reason to prefer an in-sample figure. The in-sample figure is biased, the small held-out figure is merely noisy, and noise can be quantified while bias cannot. It is a reason to read the held-out figure as a range and to say so when quoting it.

What to do when the count is small

Report the count next to every figure, without exception. Give the Fisher interval for r and a bootstrap interval for MAE, both of which take seconds. Add a grouped cross-validation estimate on the training part, which uses every molecule once and is less noisy than a tiny held-out set, while labelling it as a selection-stage figure. Repeat the split over several seeds and report the spread, as the guide on the one-seed, one-split problem describes. And resist rounding r to two decimals when the interval is a quarter of a unit wide.

If the dataset is so small that the held-out set cannot reach a dozen molecules, say that the model is a hypothesis awaiting data rather than a validated equation. The guide on dataset coverage explains why collecting more molecules on new scaffolds helps more than any amount of resampling.

Key points

  • Transform r with atanh, use standard error 1 / √(n−3), and transform back. r = 0.80 on 8 molecules spans 0.22 to 0.96.
  • One distant molecule among five can move r from −1 to 0.99. A figure on five molecules describes those five.
  • Thirty molecules give one meaningful decimal of r. A hundred give a second decimal that begins to mean something.
  • The MolBasis held-out set is 25 percent of scaffolds, so it can be small. The kernel page states the count. Read it first.
  • Report the count, give intervals, add a grouped cross-validation figure, and repeat the split over seeds.

Questions people ask

How many held-out molecules are needed for a stable Pearson r?
With the Fisher transformation, the 95 percent interval for r equal to 0.80 is about 0.22 to 0.96 on 8 molecules, 0.62 to 0.90 on 30, and 0.72 to 0.86 on 100. A few dozen molecules give a figure worth quoting to one decimal place. Fewer than ten give a figure that mostly describes the draw.
Why can one molecule change r so much on a small set?
Pearson r is driven by the products of deviations from the mean, and one molecule far from the centre contributes a product far larger than the rest. On five molecules, four clustered points with r of −1 among themselves become r of 0.99 when a fifth distant point is added. The figure then describes that one molecule.
Why are the MolBasis held-out sets sometimes small?
The protocol holds out 25 percent of unique Bemis-Murcko scaffolds, not 25 percent of molecules. When the drawn scaffolds are singletons, the held-out set holds few molecules. Each kernel page states the number its figures rest on, so the reader can judge the width of the implied interval.

Further reading

In practice: The methodology page describes the checks applied to every kernel, scaffold-blind split included, and the limits of those checks. Every kernel page quotes the held-out figure first and the in-sample figure second.

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.