stray (version 0.1.0)

use_KNN: Find outliers using kNN distance with maximum gap

Description

Find outliers using kNN distance with maximum gap

Usage

use_KNN(data, alpha = 0.01, k = 10, knnsearchtype = c("kd_tree",
  "brute"))

Arguments

data

A vector, matrix, or data frame consisting of numeric and/or categorical variables.

alpha

Threshold for determining the cutoff for outliers. Observations are considered outliers outliers if they fall in the \((1- alpha)\) tail of the distribution of the nearest-neighbor distances between exemplars.

k

Number of neighbours considered.

knnsearchtype

A character vector indicating the search type for k- nearest-neighbors.

Value

The indexes of the observations determined to be outliers and the outlying scores