How to access nodes of decision tree built using mllib in pyspark?

258 views Asked by At

My code is from pyspark.mllib.tree import DecisionTree,DecisionTreeModel

model = DecisionTree.trainClassifier(training_data)

Node = model.call("topNode")

#To access top node
tNode = model.call("topNode")
#For left node 
lNode = tNode.leftNode()

But I think there is no method for accessing leftNode/rightNode of any node except rootNode/topNode. I am also trying to use py4j library to access java objects in python. Thanks

0

There are 0 answers