Skip to content

Commit

Permalink
Fix Invalid decision type error while plotting tree in Python (#810)
Browse files Browse the repository at this point in the history
* Fix Invalid decision type error while plotting tree in Python

* Fix Invalid decision type error while plotting tree in Python (modified = to ==)
  • Loading branch information
run2 authored and guolinke committed Aug 18, 2017
1 parent 9d3226e commit 8a2b644
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python-package/lightgbm/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ def add(root, parent=None, decision=None):
if info in {'split_gain', 'internal_value', 'internal_count'}:
label += '\n' + info + ':' + str(root[info])
graph.node(name, label=label)
if root['decision_type'] == 'no_greater':
if root['decision_type'] == '<=':
l_dec, r_dec = '<=', '>'
elif root['decision_type'] == 'is':
elif root['decision_type'] == '==':
l_dec, r_dec = 'is', "isn't"
else:
raise ValueError('Invalid decision type in tree model.')
Expand Down

0 comments on commit 8a2b644

Please sign in to comment.