MerQuR+Statistics Glossary

Statistics Glossary → Local outlier factor (LOF)

Local outlier factor (LOF)concept

A method that finds outliers even in regions of the data with different densities, by comparing the density around an observation with the density around its neighbours.

For each point its k nearest neighbours are found, and its local reachability density (the inverse of its average reachability distance to its neighbours) is computed. LOF is the ratio of the neighbours' average local density to the point's own local density. A value close to 1 means the point lies in a region of similar density to its neighbours; a value clearly above 1 (e.g. above 1.5 or 2) means it sits somewhere much sparser than its neighbours and can be considered an outlier.

LOF's strength is that it is 'local': a lone point right next to a dense cluster is caught as an outlier relative to that cluster even if it looks close by global distance measures, while points in a sparse cluster are not wrongly flagged. The result is sensitive to the choice of k (the number of neighbours); a small k can lead to noise, and a large k can miss small groups of outliers. There is no universal threshold for LOF, and because the scale of the variables affects distances, they are usually standardized first. In high-dimensional data, distances become similar to one another and performance can drop.

An everyday example

At a bank most customers make 5-10 transactions a month and spend 1,000-5,000 TL, while a small group of business customers makes about 200 transactions and spends around 100,000 TL a month. An account with 15 transactions and 60,000 TL of spending a month looks broadly close to the high-spending group, but fits the dense region of neither group. LOF gives it a value of 3.2, and the account is added to the review list.

In MerQur

One of the ten anomaly criteria (LOF) under the 'Method' option of the Anomaly Detection analysis.

Analyses where this concept appears

Anomaly Detection

Related concepts

Isolation forest and contamination rateOutlier