Local Outlier Factor (LOF) — how does it work?
medium- For each point, compare its local density (via k-NN distances) to that of its neighbors.
- LOF > 1: point is in a lower-density region than its neighbors → outlier.
- Handles clusters of varying density — a big advantage over global thresholds.
- Cost or O(n log n) with indexes.
- Weakness: sensitive to k.
- Standard in tabular anomaly detection alongside Isolation Forest.