flowengineR: A Modular and Extensible Framework for Fair and Reproducible Workflow Design in R
Maximilian Willer, Peter Ruckdeschel
TL;DR
flowengineR presents an R-native framework for modular, reproducible, and fairness-aware machine learning workflows by introducing a control object and interchangeable engines that cover data splitting, preprocessing, inprocessing, postprocessing, evaluation, and reporting. The design emphasizes class-free interfaces, standardized I/O, and auditable results, enabling plug-and-play fairness interventions and easy extension via templates and LLM-assisted engine development. A concrete use case on a synthetic banking dataset demonstrates fair and transparent evaluation using metrics such as $SPD$ and $MSE$, with negligible overhead attributed to the modular architecture. The framework aims to generalize beyond fairness to explainability, robustness, and regulatory compliance, and to integrate with existing R ecosystems like mlr3 and targets through a unifying, extensible workflow infrastructure.
Abstract
flowengineR is an R package designed to provide a modular and extensible framework for building reproducible algorithmic workflows for general-purpose machine learning pipelines. It is motivated by the rapidly evolving field of algorithmic fairness where new metrics, mitigation strategies, and machine learning methods continuously emerge. A central challenge in fairness, but also far beyond, is that existing toolkits either focus narrowly on single interventions or treat reproducibility and extensibility as secondary considerations rather than core design principles. flowengineR addresses this by introducing a unified architecture of standardized engines for data splitting, execution, preprocessing, training, inprocessing, postprocessing, evaluation, and reporting. Each engine encapsulates one methodological task yet communicates via a lightweight interface, ensuring workflows remain transparent, auditable, and easily extensible. Although implemented in R, flowengineR builds on ideas from workflow languages (CWL, YAWL), graph-oriented visual programming languages (KNIME), and R frameworks (BatchJobs, batchtools). Its emphasis, however, is less on orchestrating engines for resilient parallel execution but rather on the straightforward setup and management of distinct engines as data structures. This orthogonalization enables distributed responsibilities, independent development, and streamlined integration. In fairness context, by structuring fairness methods as interchangeable engines, flowengineR lets researchers integrate, compare, and evaluate interventions across the modeling pipeline. At the same time, the architecture generalizes to explainability, robustness, and compliance metrics without core modifications. While motivated by fairness, it ultimately provides a general infrastructure for any workflow context where reproducibility, transparency, and extensibility are essential.
