Skip to content

Commit

Permalink
fix a bug in ConstructHistograms (#1400)
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed May 25, 2018
1 parent 1a1262c commit 4bb2f2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/io/dataset.cpp
Expand Up @@ -623,13 +623,17 @@ void Dataset::ConstructHistograms(const std::vector<int8_t>& is_feature_used,
used_group.reserve(num_groups_);
for (int group = 0; group < num_groups_; ++group) {
const int f_cnt = group_feature_cnt_[group];
bool is_group_used = false;
for (int j = 0; j < f_cnt; ++j) {
const int fidx = group_feature_start_[group] + j;
if (is_feature_used[fidx]) {
is_group_used = true;
break;
}
}
used_group.push_back(group);
if (is_group_used) {
used_group.push_back(group);
}
}
int num_used_group = static_cast<int>(used_group.size());
auto ptr_ordered_grad = gradients;
Expand Down

0 comments on commit 4bb2f2f

Please sign in to comment.