Skip to content

Commit

Permalink
Potential fix for microsoft#4037
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudotensor committed Mar 2, 2021
1 parent 308366d commit e498551
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/io/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ std::vector<std::vector<int>> FindGroups(
const data_size_t cur_non_zero_cnt =
is_filtered_feature ? 0 : num_per_col[fidx];
std::vector<int> available_groups;
for (int gid = 0; gid < static_cast<int>(features_in_group.size()); ++gid) {
auto cur_num_bin = group_num_bin[gid] + bin_mappers[fidx]->num_bin() +
auto bin_part = bin_mappers[fidx]->num_bin() +
(bin_mappers[fidx]->GetDefaultBin() == 0 ? -1 : 0);
for (int gid = 0; gid < static_cast<int>(features_in_group.size()); ++gid) {
auto cur_num_bin = group_num_bin[gid] + bin_part;
if (group_total_data_cnt[gid] + cur_non_zero_cnt <=
total_sample_cnt + single_val_max_conflict_cnt) {
if (!is_use_gpu || cur_num_bin <= max_bin_per_group) {
Expand Down

0 comments on commit e498551

Please sign in to comment.