Skip to content

Commit

Permalink
It fixes the bug in ResetGoss (issue #1192) (#1193)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibi789 authored and guolinke committed Jan 11, 2018
1 parent 195d953 commit fb8d2eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/boosting/goss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <string>
#include <fstream>
#include <chrono>
#include <algorithm>

namespace LightGBM {

Expand Down Expand Up @@ -75,6 +76,7 @@ class GOSS: public GBDT {
is_use_subset_ = false;
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_);
bag_data_cnt = std::max(1, bag_data_cnt);
tmp_subset_.reset(new Dataset(bag_data_cnt));
tmp_subset_->CopyFeatureMapperFrom(train_data_);
is_use_subset_ = true;
Expand Down

0 comments on commit fb8d2eb

Please sign in to comment.