arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.14556cs.SE
收藏

数据科学流水线选择性执行中单元格的替代方案

An Alternative to Cells for Selective Execution of Data Science Pipelines

Lars Reimann, Günter Kniesel-Wünsche

AI总结:

针对 notebook 在数据科学流水线选择性执行中的代码混乱、依赖管理和重复执行等缺陷,提出用基于数据流分析的变量上下文菜单操作替代单元格,实现流水线代码与决策代码分离及依赖自动化管理。

摘要:

数据科学家经常使用 notebook 来开发数据科学(DS)流水线,特别是因为它们允许选择性地执行流水线的部分内容。然而,用于 DS 的 notebook 有许多众所周知的缺陷。我们在本文中重点关注以下几个问题:(1) Notebook 可能会堆满不属于主 DS 流水线、仅为做决策而存在的代码单元格(例如列出表格数据集的列)。(2) 虽然允许用户以任意顺序执行单元格,但并非所有顺序都是正确的,因为单元格可能依赖于其他单元格中的声明。(3) 修改单元格后,该单元格及所有依赖被修改声明的单元格都必须重新运行。(4) 外部值的更改需要部分重新执行 notebook。(5) 由于单元格是最小的执行单元,不受更改影响的代码可能会被无意中重新执行。为了解决这些问题,我们提议用其他方式替代单元格作为 DS 流水线选择性执行的基础。相反,我们建议在变量的上下文菜单中填充适合其类型的操作(如当变量是表格数据集时列出列)。这些操作基于数据流分析执行,以确保变量间的依赖关系得到遵守,且更改后结果能正确更新。我们的解决方案将流水线代码与决策代码分离,并自动化依赖管理,从而减少了混乱和出错的风险。

英文摘要:

Data Scientists often use notebooks to develop Data Science (DS) pipelines, particularly since they allow to selectively execute parts of the pipeline. However, notebooks for DS have many well-known flaws. We focus on the following ones in this paper: (1) Notebooks can become littered with code cells that are not part of the main DS pipeline but exist solely to make decisions (e.g. listing the columns of a tabular dataset). (2) While users are allowed to execute cells in any order, not every ordering is correct, because a cell can depend on declarations from other cells. (3) After making changes to a cell, this cell and all cells that depend on changed declarations must be rerun. (4) Changes to external values necessitate partial re-execution of the notebook. (5) Since cells are the smallest unit of execution, code that is unaffected by changes, can inadvertently be re-executed. To solve these issues, we propose to replace cells as the basis for the selective execution of DS pipelines. Instead, we suggest populating a context-menu for variables with actions fitting their type (like listing columns if the variable is a tabular dataset). These actions are executed based on a data-flow analysis to ensure dependencies between variables are respected and results are updated properly after changes. Our solution separates pipeline code from decision making code and automates dependency management, thus reducing clutter and the risk of making errors.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑