| lof_scores | R Documentation |
Compute local outlier factors using k nearest neighbours. A local
outlier factor is a measure of how anomalous each observation is based on
the density of neighbouring points.
The function uses dbscan::lof to do the calculation.
lof_scores(y, k = 10, ...)
y |
Numerical matrix or vector of data |
k |
Number of neighbours to include. Default: 5. |
... |
Additional arguments passed to |
Numerical vector containing LOF values
Rob J Hyndman
Rob J Hyndman (2026) "That's weird: Anomaly detection using R", Section 7.3, https://OTexts.com/weird/.
dbscan::lof
y <- c(rnorm(49), 5)
lof_scores(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.