Anomaly detection using LoOP: Local Outlier Probabilities, a local density based outlier detection method providing an outlier score in the range of [0,1].
Using https://stackoverflow.com/a/47775357 as a base the euclidean distance function can be sped up (by a factor of ~2x on my machine) using np.dot rather than the naive approach.
The other changes prevent an error when all input points are identical.
Using https://stackoverflow.com/a/47775357 as a base the euclidean distance function can be sped up (by a factor of ~2x on my machine) using np.dot rather than the naive approach. The other changes prevent an error when all input points are identical.