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
b64751bf
Unverified
Commit
b64751bf
authored
Oct 26, 2018
by
Guolin Ke
Committed by
GitHub
Oct 26, 2018
Browse files
fix problems with null json node. (#1785)
parent
841d2b90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/treelearner/serial_tree_learner.cpp
src/treelearner/serial_tree_learner.cpp
+6
-2
No files found.
src/treelearner/serial_tree_learner.cpp
View file @
b64751bf
...
...
@@ -688,12 +688,16 @@ int32_t SerialTreeLearner::ForceSplits(Tree* tree, Json& forced_split_json, int*
right
=
Json
();
if
((
pair
.
first
).
object_items
().
count
(
"left"
)
>
0
)
{
left
=
(
pair
.
first
)[
"left"
];
if
(
left
.
object_items
().
count
(
"feature"
)
>
0
&&
left
.
object_items
().
count
(
"threshold"
)
>
0
)
{
q
.
push
(
std
::
make_pair
(
left
,
*
left_leaf
));
}
}
if
((
pair
.
first
).
object_items
().
count
(
"right"
)
>
0
)
{
right
=
(
pair
.
first
)[
"right"
];
if
(
right
.
object_items
().
count
(
"feature"
)
>
0
&&
right
.
object_items
().
count
(
"threshold"
)
>
0
)
{
q
.
push
(
std
::
make_pair
(
right
,
*
right_leaf
));
}
}
result_count
++
;
*
(
cur_depth
)
=
std
::
max
(
*
(
cur_depth
),
tree
->
leaf_depth
(
*
left_leaf
));
}
...
...
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