Compute Global-Local Outlier Score from Hierarchies. This is based
on hierarchical clustering where the minimum cluster size is k. The resulting
outlier score is a measure of how anomalous each observation is.
The function uses dbscan::hdbscan
to do the calculation.
Arguments
- y
Numerical matrix or vector of data
- k
Minimum cluster size. Default: 5.
- ...
Additional arguments passed to
dbscan::hdbscan
See also
dbscan::glosh
Examples
y <- c(rnorm(49), 5)
glosh_scores(y)
#> [1] 0.294041184 0.656411173 0.244278846 0.000000000 0.266382606 0.590618555
#> [7] 0.542127588 0.715781252 0.537873643 0.783946224 0.178881419 0.665407827
#> [13] 0.367072000 0.797652306 0.850926329 0.653407824 0.056007081 0.635155971
#> [19] 0.652614985 0.827186148 0.000000000 0.104812241 0.247450285 0.216076273
#> [25] 0.593656883 0.442679846 0.898654357 0.067972140 0.273819160 0.472366964
#> [31] 0.185379389 0.185379389 0.615896680 0.255303634 0.205018166 0.570359054
#> [37] 0.712700415 0.769523642 0.656117018 0.000000000 0.451488830 0.625406624
#> [43] 0.290851356 0.179834758 0.000000000 0.179834758 0.104466313 0.629075489
#> [49] 0.004060706 0.960996766