Reduce tree expand boilerplate code (#4008)

This commit is contained in:
Rory Mitchell
2018-12-20 15:52:28 +13:00
committed by GitHub
parent 84c99f86f4
commit f75a21af25
9 changed files with 34 additions and 43 deletions

View File

@@ -1184,10 +1184,9 @@ class GPUHistMakerSpecialised{
void ApplySplit(const ExpandEntry& candidate, RegTree* p_tree) {
// Add new leaves
RegTree& tree = *p_tree;
tree.AddChilds(candidate.nid);
auto& parent = tree[candidate.nid];
parent.SetSplit(candidate.split.findex, candidate.split.fvalue,
tree.ExpandNode(candidate.nid, candidate.split.findex, candidate.split.fvalue,
candidate.split.dir == kLeftDir);
auto& parent = tree[candidate.nid];
tree.Stat(candidate.nid).loss_chg = candidate.split.loss_chg;
// Set up child constraints