pyod
pyod copied to clipboard
HBOS negative scores
Hello,
I have been reading the paper Histogram-Base Outlier Score and testing a little bit with the implementation of this python module. By looking at the paper we can see that the minimum score that we can have is 0 by the normalization and logarithm in the formula but when I try it with the PyOD module I get some negative scores.
- We can still apply the rule "the bigger the score the more anomalous the instance is"?
- Why are we getting these negative values?
Thanks in advance to any reply.
I have seen the same problem and even with other algorithms, such as IForest and OCSVM
it seems that (at least for IForest), the calculated score is shifted with offset
. Probably you can undo such offset for IForest to shift the score range back to 0-1, like
iforest.decision_scores_ - iforest.detector_.offset_