From ddf8c104a415c37773b0885472ac50378fc11595 Mon Sep 17 00:00:00 2001 From: Guolin Ke Date: Thu, 2 Jul 2020 05:57:33 +0800 Subject: [PATCH] Allow the minimal feature to 1 in column sampling (#3197) Co-authored-by: StrikerRUS --- src/treelearner/col_sampler.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/treelearner/col_sampler.hpp b/src/treelearner/col_sampler.hpp index 84bd1537dd39..6debe9db60ca 100644 --- a/src/treelearner/col_sampler.hpp +++ b/src/treelearner/col_sampler.hpp @@ -31,7 +31,7 @@ class ColSampler { } static int GetCnt(size_t total_cnt, double fraction) { - const int min = std::min(2, static_cast(total_cnt)); + const int min = std::min(1, static_cast(total_cnt)); int used_feature_cnt = static_cast(Common::RoundInt(total_cnt * fraction)); return std::max(used_feature_cnt, min); }