scikit-learn/scikit-learn

Changing the label order in export_graphviz for interpretability

Open

#7 774 ouverte le 27 oct. 2016

Voir sur GitHub
 (2 commentaires) (2 réactions) (0 assignés)Python (27 020 forks)batch import
Enhancementhelp wantedmodule:tree

Métriques du dépôt

Stars
 (66 084 stars)
Métriques de merge PR
 (Merge moyen 10j) (90 PRs mergées en 30 j)

Description

Description

I occasionally present results to experimental folks, who really love decision tree models due to their interpretability. For informal meetings, I often use the export_graphviz function to create the decision tree viz and talk them through the results. However, I noticed that they are often confused about the labels in the node. I.e., what's in that node vs. what's the splitting criterion. "Do these samples at this node have a feature value x <= y?", "no, this would be the splitting criterion to produce the following child nodes"

Although, it should be somewhat clear from looking at the first node that the first line with the feature name refers to the splitting criterion, maybe it would be worthwhile swapping the order? This way the statistics in the node apply to the samples in this actual node, and the last line (the splitting criterion) would refer to the two child nodes going off from the parent node.

Or in simpler words, what do you think about putting the splitting criterion at the bottom of a node?

screen shot 2016-10-27 at 7 28 27 pm

And maybe even putting a divider line in-between?

screen shot 2016-10-27 at 7 50 35 pm

Guide contributeur