DecisionTree.jl icon indicating copy to clipboard operation
DecisionTree.jl copied to clipboard

Feature request: Interactive visualization

Open ValdarT opened this issue 7 years ago • 2 comments

With large decision trees, it is very helpful if one can interactively explore the tree (interactively expand/collapse nodes). For example: http://blog.revolutionanalytics.com/2016/12/interactive-decision-trees-with-microsoft-r.html Perhaps it is worth adding support for this, for example through D3Trees.jl. It probably makes sense as a separate package but I wanted to throw the idea out there.

ValdarT avatar Sep 30 '17 12:09 ValdarT

I put together a MVP for this D3DecisionTrees.jl. It's not all that useful currently but should be more so after a few additions:

  • Line width based on number of cases (easy if DecisionTree kept track of how many cases reach each node)
  • Feature names instead of numbers (if available; that would come with DataFrames support, I guess)
  • Nodes colors based on features (generally easy but I'm not sure how to create a legend)

Perhaps you can think of other enhancements?

PS: I'm writing this here because the first 2 points depend on the developments here and I'm curious what you think.

ValdarT avatar Dec 03 '17 16:12 ValdarT

This is great!! Thanks for putting it together.

Responding to your points:

  1. Line width - the current implementation of the Leaf type does use a vector to keep track of all the labels in it ... the plan is to use a tuple for the counts instead. We could extend Node with a similar tuple field, holding the sum label counts of its children. Hopefully this will be part of v0.7.0
  1. Feature names - yes, we would need to support DataFrames for this functionality. An existing feature request
  2. Node colors - Not sure how to go about this

Let's keep this open till 1) and 2) are resolved.

Thanks again

bensadeghi avatar Dec 22 '17 05:12 bensadeghi