Search code examples
pythonapache-sparkpysparkdecision-treedtreeviz

How can decision tree model in Spark (pyspark) be visualized?


I am trying to visualize decision tree structure in pyspark. But all the tools are for data. I could not find any for visualizing tree structure. Or is there a way I can visualize using the rules from toDebugString?


Solution

  • I have tried to do the following in order to create a visualization :

    1. Parse Spark Decision Tree output to a JSON format.
    2. Use the JSON file as an input to a D3.js visualization.

    For more code you can refer to my prototype at GitHub here.