Support gamma in GPU_Hist. (#4874)

* Just prevent building the tree instead of using an explicit pruner.
This commit is contained in:
Jiaming Yuan
2019-09-24 10:16:08 +08:00
committed by GitHub
parent a40b72d127
commit 0b89cd1dfa
2 changed files with 65 additions and 3 deletions

View File

@@ -72,8 +72,9 @@ struct ExpandEntry {
if (split.left_sum.GetHess() == 0 || split.right_sum.GetHess() == 0) {
return false;
}
if (param.max_depth > 0 && depth == param.max_depth) return false;
if (param.max_leaves > 0 && num_leaves == param.max_leaves) return false;
if (split.loss_chg < param.min_split_loss) { return false; }
if (param.max_depth > 0 && depth == param.max_depth) {return false; }
if (param.max_leaves > 0 && num_leaves == param.max_leaves) { return false; }
return true;
}