8000 fix of #6580: Exporting a single node DecisionTreeClassifier to dot graph raises error when filled is True by andrewshir · Pull Request #6582 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

fix of #6580: Exporting a single node DecisionTreeClassifier to dot graph raises error when filled is True #6582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

andrewshir
Copy link

#6580 fix: add check for equal color bounds to prevent division by zero error. Add corresponding unit test.

(colors['bounds'][1] -
colors['bounds'][0])), 0))
if colors['bounds'][0] == colors['bounds'][1]:
alpha = 255
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Or would it be fun to multiply this by the impurity? (Just wondering out aloud)

Copy link
Member

Choose a reason for hiding this comment

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

(The node's impurity)

@raghavrv
Copy link
Member

Thanks for the pull request :) LGTM pending nitpick! @tguillemot @glouppe second review?

export_graphviz(dtc, out_file=out, filled=True)

contents1 = out.getvalue()
contents2 = 'digraph Tree {\n' \
Copy link
Member

Choose a reason for hiding this comment

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

Could you avoid \ and use brackets instead?

contents2 = ('digraph Tree {\n'
             'continuation of the line'
             ...)

Copy link
Member

Choose a reason for hiding this comment

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

nitpick: contents2 --> expected?

@TomDLT
Copy link
Member
9BBB TomDLT commented Mar 24, 2016

closing as #6376 is merged

@TomDLT TomDLT closed this Mar 24, 2016
@raghavrv
Copy link
Member

Apologies @andrewshir for raising a duplicate issue! Thanks for the PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0