Data Quality for Chemical Machine Learning
Provenance, duplicate leakage, inconsistent units and missing negative results
Lesson 4365 of 4,500 · Reaction Networks and Data-Driven Chemistry
Learning objectives
- Audit provenance and units in reaction records
- Identify duplicate leakage across train and test
- Explain why missing failed reactions bias prediction
Introduction
Machine learning cannot recover information that a reaction record never captured. A product structure without temperature, solvent, reagent amount or an unsuccessful outcome is an incomplete experiment. Chemical data quality begins with provenance, consistent quantities and honest accounting of what was attempted. These details determine whether a model learns transferable chemistry or database habits.
Core explanation
A useful reaction record identifies inputs, setup, conditions, observations, analytical method, outcome and provenance. The Open Reaction Database publication describes structured records with such fields. Structured units prevent a rate in min⁻¹ from being silently pooled with one in s⁻¹. Reaction yield should state basis and measurement method; isolated yield, assay yield and conversion are different targets. Temperature needs scale and sometimes trajectory, not only one number.
Duplicate leakage occurs when the same reaction, molecule pair or close analog appears in both training and testing under different identifiers. The model can appear to generalize by recalling records. Deduplication must respect chemistry: alternate SMILES strings may describe the same structure, whereas different stereoisomers or salts may genuinely differ. Splitting by publication, scaffold, time or reaction family can test harder forms of generalization. A primary study of reaction-prediction bias showed that apparent success can reflect hidden scaffold patterns in a dataset.
Published reaction collections tend to overrepresent successful transformations. Failed or low-yield attempts are often absent even though they define the boundary of reactivity. Research on negative data in synthesis datasets examines this issue. A model trained only on reported successes may predict plausible products for conditions that actually give no reaction. Negative entries still need context: “no product” may mean below detection, poor workup recovery or the wrong analytical target, not chemical impossibility.
Provenance permits error tracing. If one instrument batch reports systematically high yields, a random split may put the same bias in train and test, hiding failure on a new instrument. Preserve raw observations, calibration, record identifiers, uncertainty and data-cleaning decisions. Do not silently discard inconvenient outliers without investigating them; they may signal new chemistry or a transcription error.
Step-by-step reasoning
1. Define the prediction target and required experimental fields. 2. Normalize units and structures while retaining raw values and provenance. 3. Detect exact and near duplicates before assigning splits. 4. Include low-yield and failed attempts with measurement definitions. 5. Audit missingness and evaluate on a split matching the intended future use.
Visual explanation
Draw two database rows labeled “same reaction” with different SMILES ordering and units of 2 min versus 120 s. An arrow merges them after normalization. Next draw train and test boxes: moving duplicate siblings into one box prevents leakage. A final panel shows a histogram of reported yields with missing low-yield attempts; its skew warns that the model sees a selected sample.
Real-world analogy
A recipe database containing only meals photographed for a cookbook cannot tell you how often a recipe failed in a normal kitchen. If the same recipe appears twice under different names in a cooking exam, memorization can look like skill. Reaction databases face the same selection and duplication problems, with added chemical structure and unit complexity.
Real-world example
A reaction-yield model is trained on patent examples. One series appears in several patents and is split randomly, producing a high test score. Grouping related publications lowers the score. Investigation finds that reaction conditions were parsed inconsistently and unsuccessful screening entries were absent. The lower grouped score more honestly reflects likely performance on a new laboratory campaign.
Why?
Why is converting units not merely cosmetic? A rate constant of 0.10 min⁻¹ equals about 0.00167 s⁻¹. Treating both numerical values as the same kind of label introduces a factor-of-60 discrepancy. A model may learn spurious correlations with the laboratory or source that used one unit, masking the error in random tests.
Common misconception
“More rows always mean more independent evidence” ignores duplicates. “No recorded product means no reaction” ignores detection and reporting. “Canonicalization can never erase chemistry” overlooks stereochemistry, protonation and mixtures. “A random test split guarantees independent validation” ignores shared scaffolds, campaigns and publications.
Worked example
Two records report the same first-order reaction: one gives k = 0.12 min⁻¹ and another k = 0.0020 s⁻¹. Since 0.12/60 = 0.0020, the labels agree after unit normalization. If a split places one record in training and the other in testing, an apparently successful prediction of the second is not independent. Suppose a third record has “0% yield” but no detection limit or reaction time. It is useful as a warning that the attempted conditions failed, yet cannot be interpreted as a rigorous rate of zero. Retain the provenance and missing-field flag rather than fabricating a precise measurement.
Quick check
1. Why should exact or near-duplicate reactions be grouped before a train/test split? Answer: Otherwise the test set may repeat training information and overstate generalization.
Exam focus
Convert a kinetic unit correctly, identify a likely duplicate, and name essential provenance fields. Explain why successful-only datasets bias a reactivity predictor. State why a missing outcome or low yield should carry detection and condition context.
Advanced insight
Missingness can be informative: a laboratory may measure intermediates only for unusual runs or publish only yields above a threshold. Standard statistical assumptions that missing entries are random then fail. Prospective evaluation on a complete new experimental campaign, including failures, is a strong test of whether a model learned chemistry rather than historical selection patterns.
Summary
Chemical ML depends on accurate, traceable reaction records. Unit errors, duplicates and missing failures can make validation scores misleading. Preserve provenance, normalize carefully and choose an independent test set representing the next scientific question.
Practice questions
1. Convert 0.12 min⁻¹ to s⁻¹. Answer: Divide by 60: 0.0020 s⁻¹. 2. Why is an isolated yield different from conversion? Answer: Isolated yield measures recovered desired product, while conversion measures consumed starting material; side products and losses can separate them. 3. What does a publication-grouped split test better than a random row split? Answer: Generalization to new reported campaigns without near-duplicate examples crossing the split. 4. Why retain a failed experiment with uncertain detection? Answer: It provides outcome-boundary information, but its uncertainty and measurement limit must remain explicit.