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
6fac4702
Commit
6fac4702
authored
Mar 26, 2017
by
Guolin Ke
Browse files
avoid NaN output.
parent
8a6bd5ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/io/tree.cpp
src/io/tree.cpp
+2
-2
No files found.
src/io/tree.cpp
View file @
6fac4702
...
...
@@ -84,9 +84,9 @@ int Tree::Split(int leaf, int feature, BinType bin_type, uint32_t threshold_bin,
// save current leaf value to internal node before change
internal_value_
[
new_node_idx
]
=
leaf_value_
[
leaf
];
internal_count_
[
new_node_idx
]
=
left_cnt
+
right_cnt
;
leaf_value_
[
leaf
]
=
left_value
;
leaf_value_
[
leaf
]
=
std
::
isnan
(
left_value
)
?
0.0
f
:
left_value
;
leaf_count_
[
leaf
]
=
left_cnt
;
leaf_value_
[
num_leaves_
]
=
right_value
;
leaf_value_
[
num_leaves_
]
=
std
::
isnan
(
right_value
)
?
0.0
f
:
right_value
;
leaf_count_
[
num_leaves_
]
=
right_cnt
;
// update leaf depth
leaf_depth_
[
num_leaves_
]
=
leaf_depth_
[
leaf
]
+
1
;
...
...
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