Extracts benchmarking metrics from a data frame that was scored with
score_anomaly() using ground truth labels.
Arguments
- scored_data
A data frame with anomaly scores, typically the output of
score_anomaly()with aground_truth_colspecified.
Examples
# \donttest{
data <- data.frame(
patient_id = 1:50,
age = rnorm(50, 50, 15),
is_error = sample(c(0, 1), 50, replace = TRUE, prob = c(0.95, 0.05))
)
scored_data <- score_anomaly(data, ground_truth_col = "is_error")
metrics <- extract_benchmark_metrics(scored_data)
print(metrics$auc_roc)
#> [1] 0.4375
# }
