| BORG-package | R Documentation |
Automatically detects and enforces valid model evaluation by identifying information reuse between training and evaluation data. Guards against data leakage, look-ahead bias, and invalid cross-validation schemes that inflate performance estimates. Supports temporal, spatial, and grouped evaluation structures. Based on evaluation principles described in Roberts et al. (2017) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/ecog.02881")}, Kaufman et al. (2012) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1145/2382577.2382579")}, and Kapoor & Narayanan (2023) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.patter.2023.100804")}.
BORG automatically detects and enforces valid model evaluation by identifying information reuse between training and evaluation data. It guards against:
Data leakage through preprocessing (normalization, imputation, PCA)
Look-ahead bias in temporal evaluation
Spatial autocorrelation violations in block CV
Target leakage through features derived from outcomes
Train-test contamination through shared identifiers
No return value. This is a package-level documentation page.
borgPrimary interface for guarding evaluation pipelines
borg_diagnoseDiagnose data dependency structure
borg_cvGenerate valid CV schemes based on diagnosis
borg_inspectInspect R objects for leakage signals
borg_validateValidate a complete evaluation workflow
borg_assimilateAssimilate leaky pipelines into compliance
BORG classifies evaluation risks as:
Evaluation is fundamentally invalid. Must be blocked. Examples: preprocessing on full data, train-test ID overlap, target leakage.
Results are biased but bounded. Performance estimates are misleading but model ranking may be preserved. Examples: insufficient spatial block size, post-hoc subgroup analysis.
BORG integrates with:
caret: trainControl, train, preProcess
rsample: vfold_cv, initial_split, rolling_origin
recipes: recipe, prep, bake
mlr3: Task, Learner, Resampling
Base R: manual index-based splitting
BORG respects the following options:
borg.auto_checkIf TRUE, automatically validate splits when using supported frameworks. Default: FALSE.
borg.strictIf TRUE, throw errors on hard violations. If FALSE, return warnings. Default: TRUE.
borg.verboseIf TRUE, print diagnostic messages. Default: FALSE.
Maintainer: Gilles Colling gilles.colling051@gmail.com (ORCID) [copyright holder]
Useful links:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.