sos: Perform stochastic outlier selection on a distance matrix

Description Usage Arguments Value Examples

Description

This function calculates for each point in a distance matrix its probabilty of being an outlier, given a certain perplexity. The perplexity parameter can be seen as the size of the neighborhood taken into account when assessing the outlierness of a given point, though contrary to k in KNNDD and LOF it does not have to be an integer but can take any positive value (should be lower than the number of points though). By setting a probability threshold the output can be converted to a hard outlier classification.

Usage

1
sos(dist, perplexity)

Arguments

dist

A distance matrix or a dist object as returned by dist

perplexity

The size of the neighborhood to be considered

Value

A list with the following entries:

outlierProbabilty

A vector of outlier probabilities

bindingProbability

A matrix with the binding probabilities between all point

Examples

1
2
3
4
irisDist <- dist(iris[, 1:4])
irisSos <- sos(irisDist, 65)
irisMDS <- cmdscale(irisDist)
plot(irisMDS, pch=19, col=ifelse(irisSos$outlierProbabilty > 0.55, 'red', 'black'))

thomasp85/anomaly documentation built on May 31, 2019, 11:12 a.m.