Hi Spark Users,

I need your help.

I've some output after running DecisionTree :

<bound method DecisionTreeModel.toDebugString of DecisionTreeModel
classifier of depth 3 with 15 nodes>

I work with Jupyter notebook and python 2.7

How I can create a  graphical representation of the Decision Tree model ?

In sklearn I can use tree.export_graphviz , in R I can see the Decision
Tree output as well .

How to make tree representation of spark in Jupyter notebook ?

My code below :

model_1 = DecisionTree.trainClassifier(joined_rdd_1, numClasses=2,
categoricalFeaturesInfo={0:2, 1:16,..},impurity='gini', maxDepth=3,
maxBins=32)

model_1.toDebugString

model_1.toDebugString()

Thanks !

Reply via email to