Local Outlier Factor (LOF) Local Outlier Factor (LOF) is an unsupervised learning method in the anomaly detection family. This page summarizes its mechanism, practical uses, important trade-offs, and a browser-based concept explorer.
What is learned. During training, the algorithm builds or adjusts the parameters and internal representation used by Local Outlier Factor (LOF). The core learning mechanism is: Measures the local density of an observation relative to its k-nearest neighbors; points with significantly lower density than neighbors are anomalies.
How training becomes inference. Prepare data → initialise the model state → evaluate the current objective → update parameters or structure → validate progress → use the final state for inference. Once training stops, the fitted state is reused on unseen inputs rather than being reconstructed from scratch. The resulting output is: An anomaly/outlier score and, after thresholding, an inlier/outlier decision.
Why practitioners use it. Identifies anomalies in datasets with varying density regimes where global methods fail. Typical fits include Network intrusion detection, localized sensor malfunction detection.
What to verify before trusting it. Memory-intensive at test time; struggles to generalize to new streaming instances without recomputing neighbor graphs. The visual simulation is intentionally simplified, so real use should still validate preprocessing, data independence, hyperparameters, uncertainty and task-appropriate metrics.
Internal statethe parameters and internal representation used by Local Outlier Factor (LOF)
Typical outputAn anomaly/outlier score and, after thresholding, an inlier/outlier decision.
Good fitNetwork intrusion detection, localized sensor malfunction detection.
Main cautionMemory-intensive at test time; struggles to generalize to new streaming instances without recomputing neighbor graphs.