Convenience function to extract the top N most anomalous records from scored data.
Value
A data frame containing the top N most anomalous records, sorted by anomaly_score (descending).
Examples
# \donttest{
data <- data.frame(
patient_id = 1:50,
age = rnorm(50, 50, 15),
cost = rnorm(50, 10000, 5000)
)
scored_data <- score_anomaly(data)
top_10 <- get_top_anomalies(scored_data, n = 10)
#> Error in scored_data %>% dplyr::arrange(dplyr::desc(.data$anomaly_score)) %>% dplyr::slice_head(n = n): could not find function "%>%"
# }
