A Grammar of Machine Learning Workflows

Data leakage affected 294 published papers across 17 scientific fields (Kapoor & Narayanan, 2023); a living survey has since grown that count to 648 across 30 fields. The dominant response has been documentation: checklists, linters, best-practice guides. Documentation reduces errors but does not close structural failures. This paper proposes a structural remedy: a grammar that decomposes the supervised learning lifecycle into 8 kernel primitives connected by a typed directed acyclic graph (DAG), with four hard constraints that reject the two most damaging leakage classes at call time. The grammar's core contribution is the terminal assess constraint: a runtime-enforced evaluate/assess boundary where repeated test-set assessment is rejected by a guard on a nominally distinct Evidence type. A companion study across 2,047 experimental instances quantifies why this matters: selection leakage inflates performance by d_z = 0.93 and memorization leakage by d_z = 0.53–1.11. Two maintained implementations (Python, R) demonstrate the claims. The appendix specification lets anyone build a conforming version.

Publication Details

Journal
ArXiv.org
Published
2026-03-14
DOI
https://doi.org/10.5281/zenodo.19023838
Primary Topic
Scientific Computing and Data Management
Type
article
Field-Weighted Citation Impact
34.32
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Grammar of Machine Learning Workflows

ArXiv.org
Scientific Computing and Data Management
34.32
article

A Grammar of Machine Learning Workflows

article en

Abstract

Data leakage affected 294 published papers across 17 scientific fields (Kapoor & Narayanan, 2023); a living survey has since grown that count to 648 across 30 fields. The dominant response has been documentation: checklists, linters, best-practice guides. Documentation reduces errors but does not close structural failures. This paper proposes a structural remedy: a grammar that decomposes the supervised learning lifecycle into 8 kernel primitives connected by a typed directed acyclic graph (DAG), with four hard constraints that reject the two most damaging leakage classes at call time. The grammar's core contribution is the terminal assess constraint: a runtime-enforced evaluate/assess boundary where repeated test-set assessment is rejected by a guard on a nominally distinct Evidence type. A companion study across 2,047 experimental instances quantifies why this matters: selection leakage inflates performance by d_z = 0.93 and memorization leakage by d_z = 0.53–1.11. Two maintained implementations (Python, R) demonstrate the claims. The appendix specification lets anyone build a conforming version.

ArXiv.org
Openalex Percentile: Top 0%
Scientific Computing and Data Management
34.32
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.