Skip to contents

One histogram per feature; the score is the summed negative log density of the bin each observation falls in. Because the features are scored independently and added, HBOS is fast and completely blind to dependence: a point at the centre of both margins but off the correlation ridge is invisible to it.

Usage

morie_hbos(X, bins = 10, mode = c("static", "dynamic"))

Arguments

X

numeric matrix, one row per observation.

bins

number of bins per feature.

mode

"static" for equal-width bins, "dynamic" for equal-count (quantile) bins.

Value

list with score, rank, densities and bin_edges.

References

Goldstein, M. and Dengel, A. (2012). Histogram-based outlier score (HBOS). KI-2012 Poster and Demo Track.

Examples

set.seed(1)
X <- cbind(rnorm(100), rnorm(100))
str(morie_hbos(X)$score)
#>  num [1:100] 1.75 1.86 3.14 3.53 2.32 ...