如何可视化Spark(pyspark)中的决策树模型? [英] How can decision tree model in Spark (pyspark) be visualized?

查看:481
本文介绍了如何可视化Spark(pyspark)中的决策树模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试可视化pyspark中的决策树结构。但是所有工具都是用于数据的。我找不到可视化树结构的​​任何东西。还是有一种方法可以使用 toDebugString 中的规则进行可视化?

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?

推荐答案

我尝试执行以下操作以创建可视化效果:

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


  1. 将Spark决策树输出解析为 JSON 格式。

  2. 使用 JSON 文件作为的输入D3.js 可视化。

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

有关更多代码,您可以在GitHub 此处

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

这篇关于如何可视化Spark(pyspark)中的决策树模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆