我的代码是
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()
但我认为除了rootNode/topNode之外,没有任何方法可以访问任何节点的leftNode/rightNode。我也在尝试使用 py4j 库来访问 python 中的 java 对象。谢谢