σ-profiles as machine-learning features, a practical guide
A σ-profile becomes a feature vector when binned on a fixed grid, or a short descriptor set through its moments. Keep one recipe and avoid leakage.
Updated November 28, 2026
A σ-profile becomes a machine-learning feature in one of three ways. Bin it on a fixed grid to get a vector of sixty numbers, take its σ-moments and total area to get a handful of interpretable descriptors, or do both and let the model choose. Whatever the choice, keep one DFT recipe per dataset, deduplicate on canonical SMILES to avoid leakage, and record the recipe version with each row.
Three representations and what each keeps
The binned histogram. Bin the per-segment σ by area on the conventional grid from -0.03 to +0.03 e/Ų with 0.001 steps, which gives sixty bins. Normalised by total area it is a shape descriptor. Unnormalised it also carries size. It is the most complete representation and the one most likely to overfit on a small dataset, since many bins are empty for most molecules and neighbouring bins are strongly correlated.
The moments and scalars. The σ-moments block of a .mfsig file gives the variance, skewness and excess kurtosis of σ over the surface. Add the total surface area, the HOMO-LUMO gap in solvent and the dipole norm and you have six numbers that a chemist can interpret. This is a strong baseline for solubility, partitioning and polarity-related targets, see σ-moments as descriptors.
The σ-surface itself. The per-segment positions, areas and σ values form a point cloud that a geometric model can consume directly. This is the richest input and the most expensive to learn from, and it is beyond this guide.
Start with the six scalars. Add the histogram if it improves a held-out score. Keep whichever generalises.
Building the matrix from a folder of files
import json, glob
import numpy as np
edges = np.arange(-0.030, 0.030 + 1e-9, 0.001)
def features(path):
with open(path, encoding="utf-8") as fh:
doc = json.load(fh)
seg = doc[SEGMENT_KEY] # key names: see /anatomy
sigma = np.array([s[SIGMA_KEY] for s in seg])
area = np.array([s[AREA_KEY] for s in seg])
hist, _ = np.histogram(sigma, bins=edges, weights=area)
hist = hist / area.sum()
scalars = [area.sum(),
doc[MOMENTS_KEY][VARIANCE_KEY],
doc[MOMENTS_KEY][SKEWNESS_KEY],
doc[MOMENTS_KEY][KURTOSIS_KEY],
doc[ENERGIES_KEY][GAP_KEY],
doc[DIPOLE_KEY]]
meta = (doc[IDENTITY_KEY][SMILES_KEY], doc[METHOD_KEY][RECIPE_KEY])
return np.concatenate([scalars, hist]), meta
paths = sorted(glob.glob("profiles/*.mfsig"))
rows, metas = zip(*(features(p) for p in paths))
X = np.vstack(rows)
print(X.shape) # (n_molecules, 6 + 60)
print(set(m[1] for m in metas)) # must be one recipeStandardise the six scalars before any distance-based or regularised model. The histogram bins already share one unit and one scale. The last print is the recipe check, and a set with more than one member means the dataset must be split or the recipe added as a feature.
Leakage, duplicates and the canonical SMILES
The commonest error in small chemical datasets is the same molecule appearing in training and test under two names. Ethanol as CCO and as OCC, a salt and its free acid, a racemate and one enantiomer. Canonicalise every SMILES with one toolkit, as the canonicalisation guide describes, and split on the canonical string. Decide beforehand whether enantiomers count as one molecule for your target. They share a σ-profile but may not share a property.
Second, split by scaffold or by cluster rather than at random when the model is meant to extrapolate to new chemotypes. A random split of a congeneric series gives an optimistic score that disappears on the next series.
One recipe per dataset
A change of functional, basis set, cavity radii or dielectric constant moves every histogram. If half the training set was computed with one recipe and half with another, the model learns to recognise the recipe, because that is the strongest signal in the data. Keep one recipe per dataset. If you must combine, add the recipe version as a categorical feature and accept that the model is now partly a recipe classifier. Every .mfsig file carries its recipe in the method block, so this check is a one-line filter. Converted legacy files deserve particular care, see converting a legacy COSMO file.
Note also that the σ in a .mfsig file is the raw per-segment value, not an averaged σ-profile. For a machine-learning feature this is fine, and arguably better, since nothing has been smoothed away. For input to a COSMO-RS or COSMO-SAC parameterisation it is not, and must not be used as such.
A worked example, aqueous solubility on a public set
The ESOL dataset of Delaney, about eleven hundred small molecules with measured log solubility in water, is a reasonable first target. Compute sigma profiles for the neutral forms, build the six scalars and the histogram as above, and fit a regularised linear model on the scalars first. Then fit a gradient-boosted model on scalars plus histogram, with a scaffold split, and compare held-out errors. Finally compare against a fingerprint baseline. The σ-profiles versus ML solubility models guide discusses what to expect and when physics-based features earn their place. The solubility models themselves live on the MolForge platform and carry their own accuracy statements, which this guide does not repeat.
Key points
- Represent a σ-profile as a sixty-bin normalised histogram, as six interpretable scalars, or both. Start with the scalars.
- Canonicalise SMILES and split on the canonical string, by scaffold where extrapolation matters, to avoid leakage.
- Keep one DFT recipe per dataset, read from each file's method block, or the model learns the recipe.
- The raw per-segment σ in a .mfsig file is a fine feature and is not an averaged COSMO-RS profile.
- Benchmark against a fingerprint baseline on a public set such as ESOL before claiming an improvement.
Questions people ask
- How many features does a binned σ-profile give?
- With the usual grid from -0.03 to +0.03 e/Ų and a 0.001 e/Ų bin width, sixty features. Many are near zero for most molecules. Normalising by total area makes the vector a shape descriptor, and adding the total area as a separate feature keeps the size information.
- Are σ-moments enough on their own?
- For many properties they are a strong, compact start. The total area, variance, skewness and kurtosis of the σ distribution, together with the HOMO-LUMO gap and the dipole norm, give a handful of physically interpretable features. Try them before the full histogram, and keep the representation that generalises.
- Can I mix σ-profiles from different DFT recipes in one training set?
- Not without a recipe feature or a correction. A change of functional, basis set or cavity moves every histogram, and the model will learn the recipe instead of the chemistry. Keep one recipe per dataset, and read it from each file's method block.
Further reading
In practice: A .mfsig file is JSON and reads with the standard library. Ordering is done on the site or through the API described in the docs, and AI agents can read the published samples through the MCP server at /mcp.
Generate a σ-profile from your SMILES
Free converter for a profile you already have, a reference-grade DFT run with its provenance record when it has to be defensible.