Recomputing statistics from stored per-molecule predictions
With a table of observed and predicted values per molecule you can recompute Pearson r, MAE, the lift over the mean and the calibration slope in a few lines.
Updated November 28, 2026
A stored table of per-molecule predictions is the most valuable artefact a model report can leave behind, because from it a reader can recompute every summary statistic without the code, the descriptors or the coefficients. You need one row per held-out molecule with the observed value and the predicted value, plus the training mean of the target. From those, Pearson r, MAE, MAE lift over the baseline and the calibration slope follow in a few lines. This guide shows the arithmetic by hand on five molecules and then in numpy.
What the table must contain
The minimum is three columns and one constant.
- An identifier per molecule, an InChIKey or canonical SMILES, so a reader can check which molecules were held out and whether any also appear in training.
- The observed value y, in stated units.
- The predicted value ŷ, in the same units.
- The training mean of y, which is the baseline prediction for every held-out molecule.
A fourth column, the scaffold, lets a reader confirm that the split was scaffold-blind. The table should contain the held-out molecules only. Mixing training rows into it inflates every statistic, which is the failure mode behind the three equations on the findings page that turned out to be full-data fits. On MolBasis such a table exists only for the blind benchmark on logP, logS and melting point, and that is why those statistics are recomputed while the kernel figures are reported.
Five molecules by hand
Take five invented held-out molecules. The observed values are 2.0, 3.0, 4.0, 5.0 and 6.0, with a training mean of 4.0. The predictions are 2.6, 3.0, 4.4, 4.6 and 5.9.
Errors, prediction minus observation, are 0.6, 0.0, 0.4, −0.4 and −0.1. Their absolute values sum to 1.5, so MAE is 1.5 divided by 5, which is 0.30.
The baseline predicts 4.0 for every molecule. Its absolute errors are 2, 1, 0, 1 and 2, summing to 6, so the baseline MAE is 1.20. The lift is 1 minus 0.30 over 1.20, which is 0.75. The model cuts the baseline error by 75 percent, well past the 30 percent threshold the MolBasis gate uses.
For Pearson r, centre both columns. Observations minus their mean of 4.0 give −2, −1, 0, 1, 2. Predictions have mean 20.5 over 5, which is 4.1, so the centred predictions are −1.5, −1.1, 0.3, 0.5, 1.8. The sum of products is 3.0 + 1.1 + 0 + 0.5 + 3.6 = 8.2. The sum of squared centred observations is 10. The sum of squared centred predictions is 2.25 + 1.21 + 0.09 + 0.25 + 3.24 = 7.04. So r is 8.2 over the square root of 70.4, which is 8.2 over 8.39, giving 0.977.
For the calibration slope, regress observed on predicted. The slope is the sum of products over the sum of squared centred predictions, 8.2 over 7.04, which is 1.165. The predictions span 3.3 units while the observations span 4.0, and the slope above one records that compression. A reader who saw only r would call this an excellent model. The slope says its predictions need stretching by about 17 percent. The calibration slope guide explains why that matters for a formulator who uses the raw number.
The same computation in numpy
import numpy as np
y = np.array([2.0, 3.0, 4.0, 5.0, 6.0]) # observed, held-out only
yhat = np.array([2.6, 3.0, 4.4, 4.6, 5.9]) # predicted
train_mean = 4.0 # baseline from the training set
mae = np.mean(np.abs(yhat - y))
mae_base = np.mean(np.abs(train_mean - y))
lift = 1.0 - mae / mae_base
r = np.corrcoef(yhat, y)[0, 1]
slope, intercept = np.polyfit(yhat, y, 1) # observed on predicted
print(f"MAE {mae:.3f} baseline {mae_base:.3f} lift {lift:.2%}")
print(f"r {r:.3f} calibration slope {slope:.3f}")Run it and the output matches the hand computation, MAE 0.300, baseline 1.200, lift 75 percent, r 0.977, slope 1.165. Note the direction of polyfit. Observed on predicted gives the calibration slope. Predicted on observed gives a different number, always r² times the reciprocal of this one, and reports in the field use both without saying which. State the direction.
Three checks the table makes possible
Once the table exists, three further checks cost almost nothing.
- Bootstrap. Resample the rows with replacement a few thousand times and recompute r and MAE each time. The 2.5th and 97.5th percentiles give an interval. On five molecules the interval will be enormous, which is the honest answer. Bootstrap confidence intervals covers the mechanics.
- Baseline sanity. Check that the training mean really is the training mean, not the mean of the held-out set. Using the held-out mean as the baseline understates the baseline error and inflates the lift.
- Residual inspection. Sort by absolute error and look at the worst five molecules. In property data they are often measurement conflicts rather than model failures, and the guide on baselines and null lift explains why the baseline should be reported alongside.
What recomputation cannot tell you
Recomputing from predictions confirms that the summary statistics follow from the table. It does not confirm that the table is what it claims to be. It cannot show that the held-out molecules were absent from training, that the split was scaffold-blind, or that the predictions were made before the observations were seen. Those are questions for the record, and reproducing a fit from a research record covers them. Recomputation is the floor of verification, not the ceiling. It is still far above a figure that cannot be recomputed at all.
Key points
- One row per held-out molecule with observed and predicted values, plus the training mean, is enough to recompute r, MAE, lift and calibration slope.
- On five invented molecules the arithmetic gives MAE 0.30 against a baseline of 1.20, a 75 percent lift, r of 0.977 and a calibration slope of 1.165.
- The calibration slope is observed regressed on predicted. State the direction, since the reverse regression gives a different number.
- On MolBasis only the blind benchmark has such a table. The kernel figures are reported, not recomputed.
- Recomputation verifies the arithmetic, not the provenance of the table.
Questions people ask
- What do I need to recompute a model's reported statistics?
- One row per held-out molecule with an identifier, the observed value and the predicted value, plus the training mean of the target for the baseline. From those columns Pearson r, MAE, MAE lift and calibration slope follow directly.
- Which MolBasis figures were recomputed rather than reported?
- Only those of the separate blind benchmark on logP, logS and melting point, because it stores per-molecule predictions. The kernel figures on the kernel pages are reported from the research record because their result files are not available for recomputation.
- What does a calibration slope above one mean?
- That the predictions are compressed. Regressing observed on predicted gives a slope greater than one when predictions span less than the observations do. A slope of one with an intercept of zero is perfect calibration, and r says nothing about it.
Further reading
In practice: The coefficients of the kernels are not published, so no kernel can be evaluated from this site alone, and no figure here was recomputed except the separate blind benchmark. The guides say what can be done with what is available.
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.