msimms / LibIsolationForest

C++, rust, julia, python2, and python3 implementations of the Isolation Forest anomaly detection algorithm.
MIT License
33 stars 11 forks source link

anomaly score #4

Closed mahdisn76 closed 5 years ago

mahdisn76 commented 5 years ago

Hi, I'm using C++. My question is, what is the return value of Score function? how can I detect a sample is anomaly or not based on the Score return value? Thank you in advance.

mahdisn76 commented 5 years ago

in the original paper by the algorithm's creator it is quoted that:

Using the anomaly score s, we are able to make the following assessment: • (a) if instances return s very close to 1, then they are definitely anomalies, • (b) if instances have s much smaller than 0.5, then they are quite safe to be regarded as normal instances, and • (c) if all the instances return s ≈ 0.5, then the entire sample does not really have any distinct anomaly.

so I need something like this.

msimms commented 5 years ago

I need to add this. Right now it's just returning the average path length.

mahdisn76 commented 5 years ago

So now it is not possible to detect whether a data is normal or it is abnormal? if it is not, when do you think you can add this feature?

msimms commented 5 years ago

Right now, you'd have to draw an arbitrary line based on the path length. However, I can probably add this in the next few days.

mahdisn76 commented 5 years ago

Thanks a lot that will be great. I'm waiting for it.

msimms commented 5 years ago

Added a NormalizedScore() method (in python, rust, and cpp).

msimms commented 5 years ago

Released in v.1.1 as "NormalizedScore".