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 37 forks source link

.fit() fails if the sum of squared distances sums to 0 #3

Closed vc1492a closed 7 years ago

vc1492a commented 7 years ago

Due to division by zero. Should return mumpy array composed of 0s.

vc1492a commented 7 years ago

Use numpy / pandas test data. Return array of all 0 probability or issue warning and break?

vc1492a commented 7 years ago

Generated dummy integer and float data to confirm that the failure stems from the fact that the sum of square distances == 0. Identified the root cause to be that all of the neighborhood distances == 0 (which itself stems from the fact that the size of the neighborhood is too small). Will suggest to the user that the number of neighbors should be increased (RuntimeWarning).