"src/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "67ca60915033e01b8f9fd664d4089b245f810fd6"
Commit fb8d2eb7 authored by Zibi789's avatar Zibi789 Committed by Guolin Ke
Browse files

It fixes the bug in ResetGoss (issue #1192) (#1193)

parent 195d9531
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <string> #include <string>
#include <fstream> #include <fstream>
#include <chrono> #include <chrono>
#include <algorithm>
namespace LightGBM { namespace LightGBM {
...@@ -75,6 +76,7 @@ public: ...@@ -75,6 +76,7 @@ public:
is_use_subset_ = false; is_use_subset_ = false;
if (gbdt_config_->top_rate + gbdt_config_->other_rate <= 0.5) { if (gbdt_config_->top_rate + gbdt_config_->other_rate <= 0.5) {
auto bag_data_cnt = static_cast<data_size_t>((gbdt_config_->top_rate + gbdt_config_->other_rate) * num_data_); auto bag_data_cnt = static_cast<data_size_t>((gbdt_config_->top_rate + gbdt_config_->other_rate) * num_data_);
bag_data_cnt = std::max(1, bag_data_cnt);
tmp_subset_.reset(new Dataset(bag_data_cnt)); tmp_subset_.reset(new Dataset(bag_data_cnt));
tmp_subset_->CopyFeatureMapperFrom(train_data_); tmp_subset_->CopyFeatureMapperFrom(train_data_);
is_use_subset_ = true; is_use_subset_ = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment