Uses the Local Outlier Factor (LOF) algorithm to identify anomalies based on local density.
It is useful for detecting outliers in multi-dimensional data that Z-score misses.
Usage
detect_density(data, k = 5, threshold = 1.5)
Value
A data frame with the outliers and their LOF score.
Arguments
data
A data frame (only numeric columns will be used).
k
Integer. The number of neighbors to consider. Defaults to 5.
threshold
Numeric. The LOF score cutoff. Values > 1 indicate potential outliers. Defaults to 1.5.