From 36dcb061a8bd3977d6c7a266e92d940c5a0f8265 Mon Sep 17 00:00:00 2001 From: tqchen Date: Mon, 6 Apr 2015 13:42:43 -0700 Subject: [PATCH] larger boundary in edge case --- src/tree/updater_colmaker-inl.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tree/updater_colmaker-inl.hpp b/src/tree/updater_colmaker-inl.hpp index 7420947e2..98139b5f7 100644 --- a/src/tree/updater_colmaker-inl.hpp +++ b/src/tree/updater_colmaker-inl.hpp @@ -406,7 +406,8 @@ class ColMaker: public IUpdater { c.SetSubstract(snode[nid].stats, e.stats); if (e.stats.sum_hess >= param.min_child_weight && c.sum_hess >= param.min_child_weight) { bst_float loss_chg = static_cast(e.stats.CalcGain(param) + c.CalcGain(param) - snode[nid].root_gain); - const float delta = d_step == +1 ? rt_eps : -rt_eps; + const float gap = std::abs(e.last_fvalue) + rt_eps; + const float delta = d_step == +1 ? gap: -gap; e.best.Update(loss_chg, fid, e.last_fvalue + delta, d_step == -1); } }