MolBasis
kernelspredictionz-scoringunitsnumpy6 min read

How to apply a property kernel to a new molecule, step by step

Applying a kernel needs the descriptor in the units of the fit, the exponent, the training mean and sd, and the coefficients, which MolBasis does not publish.

Updated November 28, 2026

A kernel is evaluated in five steps. Compute the mfsig descriptor for the molecule, put it in the units the fit used, raise it to the kernel's exponent, standardise it with the training mean and standard deviation, then multiply by the coefficient and add the intercept. MolBasis publishes the equation form and the held-out result of each kernel but not the coefficients or the standardisation constants, so a kernel cannot be evaluated from the site alone. This guide explains the procedure for a reader who holds those numbers, from their own fit or from a record.

What a kernel needs before it can produce a number

The kernel form is ŷ = β₀ + Σ βⱼ·z(fⱼ^pⱼ). Each term is a descriptor fⱼ, raised to an exponent pⱼ chosen from a grid with a step of 0.25, then z-scored. The sum has one or two terms. Six things fix the output:

  • the identity of each descriptor, one of the nine listed on /docs
  • the exponent pⱼ for each term
  • the mean and standard deviation of fⱼ^pⱼ on the training set, which define the z-score
  • the coefficients βⱼ and the intercept β₀, from one ridge solve with λ equal to 1e-3
  • the unit convention of the descriptor files the fit used
  • the descriptor version, since two descriptors changed definition during the programme

A kernel page on /kernels gives the first two and not the next two. The last two are stated on the docs and findings pages. Without the training mean and standard deviation the z-score is undefined, and without β the sum is undefined. The guide on why the coefficients matter goes through what each missing number does to a prediction.

Step one, compute the descriptor in the right units

Run the molecule through mfsig to obtain the descriptor file. Then check units. The kernels were fitted on v0.91.1 files, in which areas are stored in bohr² although the field name says aa2, and σ is in e/bohr². The current mfsig recipe v1.0.0 writes ångström units and uses MMFF94s geometries rather than UFF. A kernel fitted on bohr² values and applied to an ångström value is wrong by a factor of 3.571 on the area before the exponent is even applied. The conversion factors are on the docs page and in the mfsig guide on units and unit errors.

The geometry difference has no conversion factor. A descriptor from an MMFF94s geometry differs from the same descriptor on a UFF geometry, and no kernel page states by how much. The extraction itself is shown in from an mfsig file to a descriptor vector.

Step two, transform and standardise

Raise the descriptor to its exponent. A negative value raised to a fractional exponent is not a real number. Two of the nine descriptors can be negative, g_polar_kcal always and sigma_skewness often. Find out how the fit you are reproducing handled them and do the same. The kernel pages do not say.

Then standardise with the training constants, never with constants from your own molecules. The z-score z = (f^p - mu_train) / sd_train places your molecule on the scale the coefficients were fitted on. If you z-score with your own batch mean, every prediction shifts by an amount that depends on which molecules happen to be in the batch. The guide on z-scoring and standardisation explains why the training constants are part of the model.

Step three, a numpy snippet with placeholders

The snippet below is the whole computation. Every numeric constant in it is a placeholder. None comes from MolBasis and none will reproduce a kernel shown on the site.

import numpy as np

# PLACEHOLDERS. MolBasis does not publish coefficients, intercepts,
# training means or training standard deviations. Exponents are on
# the kernel pages. Replace every constant with values from your own fit.
BETA0 = 0.0                    # placeholder intercept
BETA = np.array([1.0])         # placeholder coefficient, one per term
EXPONENT = np.array([1.0])     # placeholder exponent, from the 0.25 grid
TRAIN_MEAN = np.array([0.0])   # placeholder mean of f**p on the training set
TRAIN_SD = np.array([1.0])     # placeholder sd of f**p on the training set

def predict(f):
    """f: descriptor value(s) in the units of the fit, shape (n_terms,)."""
    f = np.asarray(f, dtype=float)
    t = f ** EXPONENT
    z = (t - TRAIN_MEAN) / TRAIN_SD
    return BETA0 + BETA @ z

print(predict([144.0]))   # placeholder input, prints 144.0 with the placeholders

With the placeholders as written the function returns its input unchanged. Replace them and it returns a prediction in the units of the target.

A worked numeric case with invented constants shows the arithmetic. Take a one-term fit with β₀ = 3.0, β₁ = 0.8, p = 0.5, a training mean of 10 and a training standard deviation of 2. A descriptor value of 144 gives 144^0.5 = 12. The z-score is 12 minus 10, divided by 2, which is 1.0. The prediction is 3.0 + 0.8 × 1.0 = 3.8. Feed 144 × 0.2800 = 40.32 instead, the same area in Ų, and the transformed value becomes 6.35, the z-score −1.83 and the prediction 1.54. A units slip moved the answer by more than two units of the target.

Step four, check that the molecule belongs in the domain

A kernel is a line through training data. Far outside the training range of f^p the line has no support. Compute the z-score and treat a magnitude above 3 as a warning. Check scaffold novelty too, since the held-out protocol speaks for new Bemis-Murcko scaffolds, not for new chemistry in general. The guide on the applicability domain for short equations gives a hat-value computation that needs only the training vector.

Also read the limits on the kernel page. Ions are a problem for dipole_debye, which is origin-dependent for charged species. hb_donor_mass is always zero in the v0.91.1 production code path, so a kernel that uses it carries no donor information.

What the site can and cannot do today

Today the site shows the equation form, the held-out result with the number of molecules it rests on, the in-sample figure and the known limits. It does not publish coefficients, training means or standard deviations, and its figures are reported from the research record rather than recomputed because the fitting scripts and result files are not available for review. A reader who needs a number for a new molecule must refit on their own data or obtain the constants from the holder of the record. The steps above apply unchanged in either case.

A kernel without its coefficients is a hypothesis about which descriptor matters, not a calculator.

Key points

  • Five steps, in order. Descriptor, units, exponent, z-score with the training constants, then β and β₀.
  • MolBasis publishes the equation form and the held-out result but not β, β₀ or the training mean and sd, so no kernel on the site can be evaluated from the site alone.
  • The kernels were fitted on v0.91.1 files with bohr² areas and UFF geometries. Current mfsig files differ in both, and only the units have a conversion factor.
  • Negative descriptors under fractional exponents need the same handling the original fit used.
  • Check the z-score and the kernel's listed limits before you trust any output.

Questions people ask

Can I compute a property for my molecule from a MolBasis kernel page?
Not from the page alone. A kernel page gives the descriptor, the exponent and the held-out result, but not the coefficients, the intercept or the training mean and standard deviation. Without those four numbers the equation cannot return a value. You need them from your own fit or from the holder of the record.
Which units must the descriptor be in before I apply a kernel?
The units the fit used. The MolBasis kernels were fitted on mfsig v0.91.1 files, in which areas are in bohr² although the field name says aa2, and σ is in e/bohr². Current mfsig files write ångström units, so a conversion is needed before any exponent is applied.
Do I z-score the descriptor with my own molecules or with the training set?
With the training set. The training mean and standard deviation are part of the model. Using the mean of your own batch shifts every prediction by an amount that depends on which molecules you happened to include.
What happens if the descriptor is negative and the exponent is fractional?
The power is not a real number and numpy returns nan. The descriptors g_polar_kcal and sigma_skewness can be negative. Find out how the original fit handled this and do exactly the same.

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.