Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
2e6a97fb
Commit
2e6a97fb
authored
Apr 26, 2017
by
Tsukasa OMOTO
Committed by
Guolin Ke
Apr 26, 2017
Browse files
python-package: plot leaf index (#457)
parent
001fe536
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
python-package/lightgbm/plotting.py
python-package/lightgbm/plotting.py
+3
-2
No files found.
python-package/lightgbm/plotting.py
View file @
2e6a97fb
...
...
@@ -277,8 +277,9 @@ def _to_graphviz(tree_info, show_info, feature_names,
add
(
root
[
'left_child'
],
name
,
l_dec
)
add
(
root
[
'right_child'
],
name
,
r_dec
)
else
:
# leaf
name
=
'left'
+
str
(
root
[
'leaf_index'
])
label
=
'leaf_value:'
+
str
(
root
[
'leaf_value'
])
name
=
'leaf'
+
str
(
root
[
'leaf_index'
])
label
=
'leaf_index:'
+
str
(
root
[
'leaf_index'
])
label
+=
'
\n
leaf_value:'
+
str
(
root
[
'leaf_value'
])
if
'leaf_count'
in
show_info
:
label
+=
'
\n
leaf_count:'
+
str
(
root
[
'leaf_count'
])
graph
.
node
(
name
,
label
=
label
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment