Hello,

In the past I've found it extremely useful to inspect internal (non-leaf)
nodes of sklearn DecisionTrees (especially the root nodes).

However, at some point a small code optimization was made and now values of
internal nodes are no longer stored:

you can see the code that avoids storing the values here
<https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx#L1948>

                if is_leaf:
                    # Don't store value for internal nodes
                    splitter.node_value(tree.value +
                                        node_id * tree.value_stride)


I've resorted to compiling my own pyx file in order to get this behavior
back, but this is a royal PITA every time I update libraries/etc.

Could, at the very least, an option be added to
RandomForestRegressor/RandomForestClassifier that allows one to ask that
internal nodes' values be stored?  Does the optimization really save that
much time/space?

Thanks,
John

(p.s. not sure what the protocol is for putting such requests in the
pull-requests or just sending out to the general list; sorry if this isn't
the right place to post this)
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to