Orange Forum • View topic - Parsing a regression tree

Parsing a regression tree

A place to ask questions about methods in Orange and how they are used and other general support.

Parsing a regression tree

Postby hajasw » Mon Jan 01, 2001 12:08

I would like to take a regression-tree generated in orange and parse it into a macro for another software-package. I won't go into the details about why I'm not linking the software directly.

I am unable to extract all the values that appear in orangTree.printTxt. Here is the first node of my tree.

In [61]: orngTree.printTxt(rt, leafStr="%V %I")
sum_fetch<=6651.378: 4.893 [4.019-5.767]
sum_fetch>6651.378


I can get the branching criterion from

In [64]: print rt.tree.branchDescriptions
<<=6651.378, >6651.378>

In [65]: print rt.tree.branchSelector.classVar.name
sum_fetch


However, within the tree, I haven't been able to find the value associated with the first branch (in my case, 4.893).

Can anybody point me towards the objective-value for a node? General advice about parsing a model would also be appreciated.

Thanks very much,
Wayne Hajas

Postby Ales » Tue Sep 14, 2010 10:05

Try
Code: Select all
print rt.tree.nodeClassifier.defaultValue

Parsing a regression tree

Postby hajasw » Tue Sep 14, 2010 15:22

Thanks Ales!

I was able to build upon your suggestion.


In [15]: rt.tree.branches[0].nodeClassifier.defaultValue.value
Out[15]: 4.8930635452270508


Ales wrote:Try
Code: Select all
print rt.tree.nodeClassifier.defaultValue


Return to Questions & Support



cron