We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c76c823 commit 706d332Copy full SHA for 706d332
examples/src/main/python/mllib/decision_tree_runner.py
@@ -134,9 +134,12 @@ def usage():
134
categoricalFeaturesInfo=categoricalFeaturesInfo)
135
# Print learned tree and stats.
136
print "Trained DecisionTree for classification:"
137
- print " Model numNodes: %d\n" % model.numNodes()
138
- print " Model depth: %d\n" % model.depth()
139
- print " Training accuracy: %g\n" % getAccuracy(model, reindexedData)
140
- print model
+ print " Model numNodes: %d" % model.numNodes()
+ print " Model depth: %d" % model.depth()
+ print " Training accuracy: %g" % getAccuracy(model, reindexedData)
+ if model.numNodes() < 20:
141
+ print model.toDebugString()
142
+ else:
143
+ print model
144
145
sc.stop()
0 commit comments