vc1492a / PyNomaly

Anomaly detection using LoOP: Local Outlier Probabilities, a local density based outlier detection method providing an outlier score in the range of [0,1].
Other
305 stars 36 forks source link

sir, help #22

Closed lisongs1995 closed 5 years ago

lisongs1995 commented 5 years ago

In loop.py, data_store[vec][1] = distances[vec], sir, data_store is a 2 dimension numpy array and distances also, why it's legal when you give a sequence to a data_store[vec][1] ?

vc1492a commented 5 years ago

Hi @lisongs1995, thanks for opening this issue. The implementation corresponds to the algorithm as specified in the original paper. distances[vec] is a sequence of points (or a 2D numpy array as implemented here, with a sequence of points inside the array) that corresponds to the distances from that given point for all of the nearest neighbors in the neighborhood. The numpy array is indeed a 2D array, which is an array which contains a list or array of distances to the given point for the neighbors.

The implementation corresponds closely with the implementation in the original paper. Feel free to check out the multiple_gaussian_2d.py example in the examples directory to confirm PyNomaly's correspondence with the results from the original paper. I'm closing this issue as I don't see this as an error in implementation (and simply a question to be answered).