One-term versus two-term equations in property prediction
A second term always lowers in-sample error and earns its place only when it lowers held-out error. A four-point example shows how easily the first fools you.
Updated November 28, 2026
A second term earns its place only when it improves the prediction of molecules the fit never saw. In-sample it always helps, because a third coefficient can only lower the residual. MolBasis tests the second term with a feature-addition test and the 25 % scaffold-blind split, and three two-term equations that could not show a held-out gain are now shown as one-term equations. This guide works a small example, lists what a fair test looks like, and explains why correlated terms make the question harder.
In-sample, the second term always wins
Take four molecules with property values y = 1.2, 2.1, 3.5 and 5.2. The mean is 3.0. Use one standardised descriptor column z₁ = −1.342, −0.447, 0.447, 1.342, which is the standardised form of 1, 2, 3, 4.
The one-term coefficient is the sum of z₁ times the centred y, divided by 4.001. The centred y is −1.8, −0.9, 0.5, 2.2. The products are 2.415, 0.402, 0.224 and 2.952, which sum to 5.993. So β₁ = 1.498. The predictions are 0.990, 2.330, 3.670 and 5.010, and the residuals are 0.210, −0.230, −0.170 and 0.190. The mean absolute error is 0.800/4 = 0.200.
Now add a second standardised column z₂ = 1, −1, −1, 1. It is orthogonal to z₁, so β₁ does not move. The products of z₂ with the centred y are −1.8, 0.9, −0.5 and 2.2, which sum to 0.8, so β₂ = 0.200. The two-term predictions are 1.190, 2.130, 3.470 and 5.210. The residuals shrink to 0.010, −0.030, 0.030 and −0.010, and the mean absolute error falls to 0.020.
A tenfold drop in error. On four points with three coefficients, that is not evidence of anything. The second column was built to match the residual pattern, and with only four points almost any new column does.
What a fair test of the second term looks like
The in-sample gain says nothing, so the test must look elsewhere. Three tests are available, and the MolBasis gate uses all of them.
- The feature-addition test. Fit the one-term equation on the training molecules, then ask whether the best two-term equation beats it on molecules that neither fit has seen. Both equations are judged on the same held-out set.
- Nested cross-validation. Choose between one and two terms inside each training fold, then score the choice on the outer fold. The guide on nested cross-validation sets this out.
- The scaffold-blind split. Set aside 25 % of the Bemis-Murcko scaffolds before any fitting, choose the equation on the remaining 75 %, and report the held-out error.
Criteria such as adjusted R² and AIC penalise the extra coefficient. They do not penalise the hundreds of candidate second terms the search tried. With four points they would also prefer the two-term fit above, because the residual fell so far. The guide on in-sample versus held-out explains why no in-sample correction replaces a held-out set.
Correlated terms make the second coefficient unstable
When the two terms are correlated, as σ variance and σ kurtosis often are, the second coefficient absorbs part of the first. The ridge solve with its small λ divides the shared effect between them, as the guide on ridge regression shows with two identical columns. The predictions stay sensible. The individual coefficients do not.
This has a practical consequence. A two-term equation whose second coefficient is small and whose terms are correlated may be a one-term equation in disguise. The second term adds a few thousandths to in-sample r and nothing to held-out MAE. The plateau count in the gate, which counts equations within ±0.01 r of the best, will usually show the one-term version sitting on the same plateau.
Three equations that went back to one term
The MolBasis record once showed three two-term equations with held-out figures. On audit, those figures came from fits on all the data, with no scaffold set aside. The second term had never been tested on unseen molecules. The site now shows them as one-term equations, and the findings page records the correction without hiding the earlier claim.
The guide on full-data fits mislabelled as validated describes how the error was found. The lesson for the one-term versus two-term question is simple. A second term that has only an in-sample gain to its name has no gain at all.
The second term is innocent until it predicts a molecule the fit never saw.
Each kernel page states whether it rests on one or two terms, shows the held-out result and the number of molecules behind it, and gives the in-sample figure second. Read it in that order.
Key points
- An extra coefficient always lowers in-sample error. Four points and three coefficients can cut MAE tenfold with no real signal.
- The second term is tested on held-out molecules through a feature-addition test, nested cross-validation and the 25 % scaffold-blind split.
- Adjusted R² and AIC correct for coefficients, not for the candidates the search tried.
- Correlated terms share a coefficient, and a weak second term often sits on the same plateau as the one-term equation.
- Three MolBasis two-term equations were full-data fits and are now shown as one-term equations.
Questions people ask
- Does adding a second descriptor term always improve a fit?
- In-sample, yes, because an extra coefficient can only lower the residual sum of squares. On held-out molecules it improves the fit only when the second term carries real signal, and that is the test that matters.
- How does MolBasis decide between one and two terms?
- The record applies a feature-addition test within its gate and reports the result on a 25 % scaffold-blind split. Three two-term equations that had been fitted on all the data are now shown as one-term equations.
- Can adjusted R² or AIC settle the question?
- They correct for the number of coefficients, not for the number of candidates the search tried. With a few dozen molecules they are weak, and they cannot see the optimism of choosing the second term from many options.
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.