Replies: 2 comments
-
I think such an optimization is certainly in scope. Creating an issue from this to have it keep tracked. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Can I get a review on #25186? I am not sure if compatibility with forests trained prior to this change should be kept |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
When using IsolationForest predict, we go down the path to _compute_score_samples. This executes
tree.apply
andtree.decision_path
. Both calls will iterate over the tree for each sample inX
. So we are evaluation the tree 2 times.tree.decision_path
returns a csr matrix containing the nodes indexes that were visited in the tree, to them later just have the count of indexes summed later.We can save time in predict if instead of calling
tree.decision_path
, atree.decision_path_length
that return an integer exists. But that would required changing the_tree.pyx
file. Some changes could also avoid the call totree.apply
, avoiding 2 times iterating on the tree.Is this something that would be accepted as PR, or changing the tree cpython files for this would not be accepted?
Beta Was this translation helpful? Give feedback.
All reactions