LOF vs k-NN in data with varying density When the dataset is comprised of regions of varying densities, which technique is more effective for outlier detection Localised Outlier Factor(LoF) or K-Nearest neighbors (KNN)

LOF was designed for this situation of data with varying densities, so, you should give it a try. But there is no guarantee that it is working better than kNN or other methods. In my experience, the results from LOF are usually disappointing compared to kNN, isolation forest, autoencoders, ..., but YMMV.
