loc.Rd
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.
loc(d, classes, r, thres = 0.4, minn = 3, minnStrategy = "include")
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. |
Vector of indexes of outliers
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.