Learn R Programming

spectralAnomaly (version 0.1.1)

anomaly_thresh: Apply threshold to anomaly score

Description

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

Usage

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

Value

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

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.

Examples

Run this code
test_data <- c(1,2,3,4,5,100,5,4,3,2,1)
anomaly_thresh(test_data, 0.99)

Run the code above in your browser using DataLab