Graph
Local Outlier Factor

🧭Local Outlier Factor

NEW

Also known as: LOF

A density-based outlier detection algorithm that flags points with substantially lower local density than their neighbors.

DESCRIPTION

Local Outlier Factor (LOF) measures how isolated a point is relative to the density of its neighborhood. It computes local reachability density and compares it to neighbors to derive an outlier score. LOF identifies local anomalies that global methods might miss. It requires choosing k (neighbors) and may struggle with high-dimensionality. LOF is unsupervised and suited to datasets with varying density clusters. Careful scaling and parameter selection improve performance.

ALTERNATIVE DEFINITIONS

scikit-learn

The Local Outlier Factor (LOF) algorithm computes the local density deviation of a given data point with respect to its neighbors.

Focuses on local density deviation as the core principle.

Source

Wikipedia

In anomaly detection, the local outlier factor (LOF) of a data point is a measure of the local deviation of the density of a given data point with respect to its neighbors.

Defines LOF via density deviation in a neighborhood context.

Source

ACM

LOF: Identifying Density-Based Local Outliers.

Original paper title emphasizing density-based local outliers.

Source

Data Anomaly Detection Kernel Density Estimation K-Nearest Neighbors Unsupervised Learning Outlier Score DBSCAN HDBSCAN Contamination

COMPETING TERMS

Isolation Forest One-Class SVM

KNOWLEDGE AREAS

AI Data Science MLOps Mathematics

TARGET AUDIENCE

Data Scientist AI Engineer MLOps Engineer

EXTERNAL SOURCES

TOP QUESTIONS

When is Local Outlier Factor a good choice?

When anomalies are local relative to neighborhood density and datasets have varying cluster densities. It captures nuanced local deviations.

Category: Advice

What are LOF’s key parameters?

The number of neighbors (k) and metric choice. These shape neighborhood structure and density estimates.

Category: Requirements

What are risks with LOF?

High-dimensional data can mask densities (curse of dimensionality). Poor k selection yields unstable results.

Category: Risks

How does LOF compare to Isolation Forest?

LOF is density-based and local; Isolation Forest is partition-based and scales better. LOF can catch local anomalies where IF may not.

Category: Alternatives

How to evaluate LOF performance?

Use labeled datasets with precision-recall if available. Otherwise, validate anomalies with domain expertise and case review.

Category: Requirements

What is a common misunderstanding about LOF?

That a single k works universally. Different densities may require tuning or multiple evaluations.

Category: Misunderstanding

What’s a hot topic around LOF?

Scalable LOF variants and approximate nearest neighbor methods to handle large, high-dimensional datasets.

Category: Topic

How to deploy LOF in production?

Stabilize preprocessing and k, monitor score distributions, and periodically reassess neighborhood parameters with new data.

Category: Management

How to choose k for LOF?

Start with domain-informed scales, perform sensitivity analysis, and cross-validate on known anomalies if available.

Category: Advice