extraTrees icon indicating copy to clipboard operation
extraTrees copied to clipboard

How to get leaf indices that each sample was assigned to in the forest

Open moldach opened this issue 5 years ago • 2 comments

In Python's scikit-learn the ExtraTreesClassifier function returns a numpy array which contains the leaf indices that each sample was assigned to in the forest.

I'm trying to get similar information from extraTrees package.

I've documented the problem extensively in this StackOverflow post.

In the post I was able to get this information from the randomForest package, but due to speed/accuracy would prefer to use the extraTrees package.

Is it possible to get this information from your package and if not could it be a feature request?

moldach avatar Dec 22 '19 16:12 moldach

It can be a feature request.

I checked the code and some modifications are needed to have that feature. Specifically, currently the trees (and leaves) are not stored in an array, so there is no indexing available. If that change is carried out adding this feature is straightforward.

jaak-s avatar Dec 22 '19 20:12 jaak-s

Can you please add this as a feature request?

moldach avatar Feb 17 '21 03:02 moldach