iso_forest
iso_forest copied to clipboard
Fix error: Division by zero in c_factor
Hello! We were working with some experimental data and found out that in some cases the algorithm would throw an error because we were dividing by zero in the function c_factor. We narrowed down the bug and found that it was because some nodes of type 'exNode' are of size zero (these are generated in the method make_tree - lines 89-93). A simply change from the equality check to the minor or equal check fixed that for us.