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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
When using IsolationForest predict, we go down the path to _compute_score_samples. This executes
tree.applyandtree.decision_path. Both calls will iterate over the tree for each sample inX. So we are evaluation the tree 2 times.tree.decision_pathreturns 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_lengththat return an integer exists. But that would required changing the_tree.pyxfile. 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