Re: [Scikit-learn-general] How to get all rules in a tree by leaf node path

2013-02-27 Thread Gilles Louppe
Hi David, I think you should have a look at sklearn.tree.export_graphviz. It will generate a picture of the tree for you. - Reference: http://scikit-learn.org/dev/modules/generated/sklearn.tree.export_graphviz.html#sklearn.tree.export_graphviz - Example: http://scikit-learn.org/dev/_images/iris.s

[Scikit-learn-general] How to get all rules in a tree by leaf node path

2013-02-26 Thread David Montgomery
Hi, I will be using a tree. All dependent variables are categorical ordinal. For each leaf node. I need to get the node id and a list of all attributes that make up the path to the leaf node. E.g. root_node GEO: NewYork Boston,Philly BOSTON:PHILLY->T