View source: R/borg_validate.R
| borg_validate | R Documentation |
borg_validate() performs post-hoc validation of an entire evaluation
workflow, checking all components for information leakage.
borg_validate(workflow, strict = FALSE)
workflow |
A list containing the evaluation workflow components:
|
strict |
Logical. If TRUE, any hard violation causes an error. Default: FALSE (returns report only). |
borg_validate() inspects each component of an evaluation workflow:
Split validation: Checks train/test index isolation
Preprocessing audit: Traces preprocessing parameters to verify train-only origin
Feature audit: Checks for target leakage and proxy features
Model audit: Validates that model used only training data
Threshold audit: Checks if any thresholds were optimized on test data
A BorgRisk object containing a comprehensive
assessment of the workflow.
borg for proactive enforcement,
borg_inspect for single-object inspection.
# Validate an existing workflow
data <- data.frame(x = rnorm(100), y = rnorm(100))
result <- borg_validate(list(
data = data,
train_idx = 1:70,
test_idx = 71:100
))
# Check validity
if (!result@is_valid) {
print(result) # Shows detailed risk report
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.