Preprocessing leakage arises when scaling, imputation, or other data-dependent transformations are estimated before resampling, inflating apparent performance while remaining hard to detect. We present fastml, an R package that provides a single-call interface for leakage-aware machine learning through guarded resampling, where preprocessing is re-estimated inside each resample and applied to the corresponding assessment data. The package supports grouped and time-ordered resampling, blocks high-risk configurations, audits recipes for external dependencies, and includes sandboxed execution and integrated model explanation. We evaluate fastml with a Monte Carlo simulation contrasting global and fold-local normalization, a usability comparison with tidymodels under matched specifications, and survival benchmarks across datasets of different sizes. The simulation demonstrates that global preprocessing substantially inflates apparent performance relative to guarded resampling. fastml matched held-out performance obtained with tidymodels while reducing workflow orchestration, and it supported consistent benchmarking of multiple survival model classes through a unified interface.
翻译:预处理泄漏是指在重采样之前对缩放、插补或其他数据依赖型变换进行估计,导致模型表观性能被高估且难以检测的现象。我们提出fastml这一R语言包,通过有监督重采样机制提供单函数调用的泄漏感知机器学习接口——该机制在每个重采样折内重新估计预处理步骤并应用于对应的评估数据。该包支持分组和时间序列重采样,可阻断高风险配置配置,审计配方中的外部依赖关系,并集成沙箱执行与模型解释功能。我们通过蒙特卡洛模拟对比全局归一化与折内局部归一化、在同等规范下与tidymodels进行可用性比较、以及跨不同规模数据集的生存分析基准测试来评估fastml。模拟结果表明,相较有监督重采样,全局预处理显著高估表观性能。fastml在降低工作流编排复杂度的同时,实现了与tidymodels相当的留出集性能,并通过统一接口支持多类生存模型的一致性基准测试。