Skip to content

Conversation

@takoika
Copy link
Contributor

@takoika takoika commented Dec 20, 2021

Reference Issues/PRs

Fixes #7774 . Add a separator line.

What does this implement/fix? Explain your changes.

Add a separator line between a criteria and other contents in node in export_graphviz which increase visibility of exported tree. Precisely the PR introduced a new boolean parameter add_separator to export_graphviz method. When add_separator is set as True, a separator line is added in an each node. This is achieved by using Record-based Nodes (see https://graphviz.org/doc/info/shapes.html#record).

Any other comments?

A node shape becomes record not box with add_separator=True. This PR does not break backward compatibility because add_separator=False in default.

Obtained graphs are shown below.
add_separator=False (conventional)
old
add_separator=True (new)
new
"class_names":True, "filled":True, "leaves_parallel":True, "node_ids":True, "proportion":True, "rotate":True, "rounded":True, "add_separator":True, "special_characters":True} (separator with other parameters activated)
all

"}"
)

assert contents1 == contents2
Copy link
Contributor Author

@takoika takoika Dec 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filling missing assertion is not in a scope of this PR. So if this is not appropriate in the point of view of reviewing process, I will remove it from this PR and make a new PR for this fix.

@takoika takoika changed the title [WIP] Add a separator between criteria and other contents in a node in export_graphviz for visibility Add a separator between criteria and other contents in a node in export_graphviz for visibility Dec 23, 2021
@takoika takoika changed the title Add a separator between criteria and other contents in a node in export_graphviz for visibility Add a separator between a criteria and other contents in a node in export_graphviz for visibility Dec 23, 2021
@takoika takoika changed the title Add a separator between a criteria and other contents in a node in export_graphviz for visibility [MRG] Add a separator between a criteria and other contents in a node in export_graphviz for visibility Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing the label order in export_graphviz for interpretability

1 participant