Hi All,
I have a mlib model:
val model = DecisionTree.train(parsedData, Regression, Variance, maxDepth)

I see model has following methods:algo           asInstanceOf   isInstanceOf   
predict        toString       topNode
model.topNode outputs:org.apache.spark.mllib.tree.model.Node = id = 0, isLeaf = 
false, predict = 0.5, split = Some(Feature = 87, threshold = 
0.7931471805599453, featureType =  Continuous, categories = List()), stats = 
Some(gain = 0.893333, impurity = 0.350000, left impurity = 0.122222, right 
impurity = 0.000000, predict = 0.500000)
I was wondering what is the best way to look at the model. We want to see what 
the decision tree looks like-- which features are selected, the details of 
splitting, what is the depth etc. Is there an easy way to see that? I can 
traverse it recursively using topNode.leftNode and topNode.rightNode. However, 
was wondering if there is any way to look at the model and also to save it on 
the hdfs for later use. 
                                          

Reply via email to