Covariate shift occurs when feature distributions change between training and deployment while the true relationship between features and the target remains unchanged. This can reduce reliability when inference data occupies unfamiliar chemical space. section 4.1.3
Molecular-weight distribution shift
Suppose a solubility model trains only on molecules below 500 daltons, then encounters more molecules above 500 daltons during inference. Molecular-weight distributions differ, but the relationship between molecular weight and solubility has not fundamentally changed; predictions may still generalize poorly because deployment moves beyond the training distribution. section 4.1.3
Listing 4.3 Compute RDKit Descriptors
from rdkit.Chem import (
Crippen,
Descriptors,
GraphDescriptors,
Lipinski,
MolFromSmarts,
rdMolDescriptors,
)
def AromaticProportion(mol):
if mol is None or mol.GetNumAtoms() == 0: #A
return 0.0 #A
aromatic_atoms = mol.GetSubstructMatches(
MolFromSmarts("a")
)
return len(aromatic_atoms) / mol.GetNumAtoms()
RDKIT_DESCRIPTORS = {
'Molecular Weight' : Descriptors.MolWt,
'Number of H-Bond Donors' : Descriptors.NumHDonors,
'TPSA' : Descriptors.TPSA,
'logP' : Crippen.MolLogP,
'Molar Refractivity' : Crippen.MolMR,
'Number of Rotatable Bonds' : Lipinski.NumRotatableBonds,
'Number of Rings' : rdMolDescriptors.CalcNumRings,
'LabuteASA' : rdMolDescriptors.CalcLabuteASA,
'BalabanJ' : GraphDescriptors.BalabanJ,
'BertzCT' : GraphDescriptors.BertzCT,
'Aromatic Proportion' : AromaticProportion,
}
for desc, func in RDKIT_DESCRIPTORS.items():
train_df[desc] = train_df["Molecule"].apply(func)Inspect the RDKit descriptors that define molecular feature distributions, including molecular weight, hydrogen-bond donors, TPSA, logP, rings, and aromatic proportion. section 4.1.3

