Skip to main content
QUICK REVIEW

[论文解读] A Grammar of Machine Learning Workflows

Roth, Simon|arXiv (Cornell University)|Mar 11, 2026
Scientific Computing and Data Management被引用 0
一句话总结

一个基于语法的类型状态框架通过对八个内核原语施加四个调用时约束,将泄漏预防嵌入监督学习生命周期,实现拒绝调用的工作流以防止数据泄漏。

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.

研究动机与目标

  • 将数据泄漏视为结构性问题,文档无法解决。
  • 提出一个组合式语法,将 ML 生命周期分解为带守卫的类型化原语。
  • 将泄漏防止规则嵌入调用时的强制机制,以拒绝无效工作流。
  • 通过 Python 与 R 的实现并提供可移植性附录来演示语法。

提出的方法

  • 定义八个核心 ML 生命周期原语(split、cv、prepare、fit、predict、evaluate、explain、assess)。
  • 构建一个类型化有向无环图(type DAG),连接原语以建模数据流并强制终结的 assess 边界。
  • 引入四个硬性、经验性支持的约束,在调用时拒绝泄漏(assess-once、split 之后的 per-fold prepare、类型安全的转移、fit 时不接入未注册数据)。
  • 解释 evaluate(形成性)与 assess(总结性)之间的终结边界以及如何由守卫强制实现此分离。
  • 提供两种语言实现(Python 和 R)以及一个 Julia 内部概念证明,展示可移植性与对规范的一致性。
  • 提供符合性条件以对实现进行基于 type DAG 与四个约束的验证。

实验结果

研究问题

  • RQ1通过语法在结构层面拒绝数据泄漏是否可能,而非事后检测?
  • RQ2覆盖监督学习生命周期所需的最小原语与约束是什么,以防止泄漏?
  • RQ3调用时的守卫检查与事后泄漏检测在防止无效工作流方面有何对比?
  • RQ4终结的 assess-once 约束是否有效防止跨模型重复的测试集评估?
  • RQ5Python 与 R 的实现如何体现正式规范并保持可移植性?

主要发现

  • 该语法在调用时强制四个硬性约束,防止主要的泄漏类别,并使重复的测试集评估在终结边界处可检测。
  • 初步研究表明 Class II 泄漏效应(选择偏倚)较大,支持结构性防护的必要性;但某些效应(如堆叠泄漏)在伴随研究中被证伪。
  • 终结性的 assess-once 约束在实践中有效,有证据显示在种子和选择策略使用时存在膨胀,以及有三项预测中的两项得到验证。
  • 两个具体实现(Python 和 R)符合八个原语和四个约束,第三个(Julia)作为可移植性证明。
  • 附录规范使独立的重实现与对语法和守卫的验证成为可能。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。