The LOF algorithm is an unsupervised density based outlier detection method which computes the local density deviation of a given data point with respect to its neighbors. It considers as outlier samples that have a substantially lower density than their neighbors.
- Step 1: Calculation of distance between every two data points
- Step 2: Calculation of the distance between each point and its kth nearest neighbour [distk(o)]
- Step 3: Calculation of k-distance neighbourhood of each point.
- Step 4: Calculation of local reachability density (LRD).
- Step 5: Calculation of LOFk(o).
- Step 6: Sort the LOFk(o) in descending order and pick the top n outliers.
k=100
k=300