Unverified Commit 3dd4a3f9 authored by shiyu1994's avatar shiyu1994 Committed by GitHub
Browse files

skip empty bin when calculating cnt_in_bin in BinMapper::FindBin (fix #4301) (#4325)

parent 36957ed5
......@@ -411,7 +411,7 @@ namespace LightGBM {
cnt_in_bin.resize(num_bin_, 0);
int i_bin = 0;
for (int i = 0; i < num_distinct_values; ++i) {
if (distinct_values[i] > bin_upper_bound_[i_bin]) {
while (distinct_values[i] > bin_upper_bound_[i_bin] && i_bin < num_bin_ - 1) {
++i_bin;
}
cnt_in_bin[i_bin] += counts[i];
......
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