diff --git a/include/xgboost/base.h b/include/xgboost/base.h index 3674c6117..a3b8c31f5 100644 --- a/include/xgboost/base.h +++ b/include/xgboost/base.h @@ -62,9 +62,7 @@ struct bst_gpair { }; /*! \brief small eps gap for minimum split decision. */ -const float rt_eps = 1e-5f; -/*! \brief min gap between feature values to allow a split happen */ -const float rt_2eps = rt_eps * 2.0f; +const float rt_eps = 1e-6f; /*! \brief define unsigned long for openmp loop */ typedef dmlc::omp_ulong omp_ulong; diff --git a/src/tree/updater_colmaker.cc b/src/tree/updater_colmaker.cc index ded1dcdfe..79c013e29 100644 --- a/src/tree/updater_colmaker.cc +++ b/src/tree/updater_colmaker.cc @@ -291,7 +291,7 @@ class ColMaker: public TreeUpdater { ThreadEntry &e = stemp[tid][nid]; float fsplit; if (tid != 0) { - if (std::abs(stemp[tid - 1][nid].last_fvalue - e.first_fvalue) > rt_2eps) { + if (stemp[tid - 1][nid].last_fvalue != e.first_fvalue) { fsplit = (stemp[tid - 1][nid].last_fvalue + e.first_fvalue) * 0.5f; } else { continue; @@ -352,7 +352,7 @@ class ColMaker: public TreeUpdater { e.first_fvalue = fvalue; } else { // forward default right - if (std::abs(fvalue - e.first_fvalue) > rt_2eps) { + if (fvalue != e.first_fvalue) { if (need_forward) { c.SetSubstract(snode[nid].stats, e.stats); if (c.sum_hess >= param.min_child_weight && @@ -393,7 +393,7 @@ class ColMaker: public TreeUpdater { e.last_fvalue = fvalue; } else { // try to find a split - if (std::abs(fvalue - e.last_fvalue) > rt_2eps && + if (fvalue != e.last_fvalue && e.stats.sum_hess >= param.min_child_weight) { c.SetSubstract(snode[nid].stats, e.stats); if (c.sum_hess >= param.min_child_weight) { @@ -511,7 +511,7 @@ class ColMaker: public TreeUpdater { e.last_fvalue = fvalue; } else { // try to find a split - if (std::abs(fvalue - e.last_fvalue) > rt_2eps && + if (fvalue != e.last_fvalue && e.stats.sum_hess >= param.min_child_weight) { c.SetSubstract(snode[nid].stats, e.stats); if (c.sum_hess >= param.min_child_weight) {