dtreeviz icon indicating copy to clipboard operation
dtreeviz copied to clipboard

is multi-output decision tree supported?

Open badrisnps opened this issue 3 years ago • 3 comments

If I have a multi output decision tree, such as https://scikit-learn.org/stable/auto_examples/tree/plot_tree_regression_multioutput.html is this intended to be supported?

I did note that target_name can be specified, as seen in your example below. Wondering a joint tree could be shown for multiple targets. I can imagine it will be messy.

classifier = tree.DecisionTreeClassifier(max_depth=2) # limit depth of tree iris = load_iris() classifier.fit(iris.data, iris.target)

viz = dtreeviz(classifier, iris.data, iris.target, target_name='variety', feature_names=iris.feature_names, class_names=["setosa", "versicolor", "virginica"] # need class_names for classifier )

viz.view()

badrisnps avatar Feb 21 '22 19:02 badrisnps

hi. @tlapusan and I have not thought about this particular feature. how common is it?

parrt avatar Feb 21 '22 21:02 parrt

I'm not sure how common it is, absolutely not as common as single target classification. People tend to work around it by making a model per target, but that results in sub-optimal results, but it does work.

badrisnps avatar Feb 22 '22 04:02 badrisnps

Hmm...well, I'll leave as a feature request though likely not high in my priority list at moment.

parrt avatar Feb 23 '22 01:02 parrt