Issue
decReg = DecisionTreeRegressor()
clf = decReg.fit(X, Y)
Intuitively anyone would expect either decReg or calf should have a function which will return the number of nodes in the tree grown. But, I am unable to see any such function. Is there anything else to know the tree size?
Solution
According to the documentation, there's tree_
attribute, you can traverse that tree to find any properties of interest. In particular, children_right
and children_left
properties seem to be useful.
Answered By - Artem Sobolev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.