Unverified Commit b64751bf authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix problems with null json node. (#1785)

parent 841d2b90
......@@ -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));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment