DecisionTree.jl
DecisionTree.jl copied to clipboard
Feature request: Interactive visualization
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.
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.
This is great!! Thanks for putting it together.
Responding to your points:
- 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 extendNode
with a similar tuple field, holding the sum label counts of its children. Hopefully this will be part of v0.7.0
- Feature names - yes, we would need to support DataFrames for this functionality. An existing feature request
- Node colors - Not sure how to go about this
Let's keep this open till 1) and 2) are resolved.
Thanks again