loc: classwise local outliers

Description Usage Arguments Details Value

View source: R/loc.R

Description

Detect local outliers when an observation of class A occurs in the neighborhood of class B using fixed radius neighborhood search. When the fraction of neighbors of the same class as the observation is less than the threshold, it is considered as an outlier.

Usage

1
loc(d, classes, r, thres = 0.4, minn = 3, minnStrategy = "include")

Arguments

d

object of class 'dist'

classes

(factor) Vector of classes

r

Value of the fixed radius

thres

Threshold for the fraction of observations of same class

minn

Minimum number of neighbors in the neighborhood

minnStrategy

When minnStrategy is 'include', the points with less than minn neighbors are considered outliers.

Details

Ideal conditions for using this is when there is no data imbalance and there are observations similar to eachother but from different classes. When minnStrategy is 'include', the global outliers (ones with less than minn neighbors) are included in the output.

Value

Vector of indexes of outliers


talegari/sidekicks documentation built on Sept. 26, 2018, 4:18 p.m.