Click a point to inspect its k-nearest neighbours

Data Mining: Local Outlier Factor Explorer (2D)

This lab renders a synthetic 2D point cloud with deliberately varying density โ€” one tight dense cluster, one loose-but-internally-consistent sparse cluster, a planted local outlier sitting just off the dense cluster's edge, and a few genuine global outliers scattered around โ€” and runs the real Local Outlier Factor algorithm over it from scratch: for every point it brute-force computes distances to all others, finds the k nearest neighbours, derives a local reachability density from their reach-distances, and scores each point by how much sparser its neighbourhood is than its neighbours' neighbourhoods. Points are coloured by that score from blue (LOF โ‰ˆ 1) through yellow to red (LOF far above 1), the k slider changes how many neighbours define "local", a comparison toggle overlays a naive global-distance-threshold detector so you can see it wrongly flag the whole sparse cluster while missing the planted local outlier that LOF catches correctly, and clicking any point draws lines to its k-nearest neighbours while reporting its exact LOF score and 1-NN distance.