Skip to contents

A helper function that wraps around quantile to apply a threshold to anomaly scores.

Usage

anomaly_thresh(x, threshold = 0.99, ...)

Arguments

x

Numeric vector of anomaly scores (e.g. created by anomaly_score).

threshold

Numeric value to determine the threshold to flag outliers among the score.

...

Additional parameters passed to quantile.

Value

Logical vector referencing which, if any, of the provided values are outliers.

Examples

test_data <- c(1,2,3,4,5,100,5,4,3,2,1)
anomaly_thresh(test_data, 0.99)
#>  [1] FALSE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE