Define bin type. (#7850)

This commit is contained in:
Jiaming Yuan
2022-04-29 19:41:39 +08:00
committed by GitHub
parent f7db16add1
commit 288c52596c
4 changed files with 25 additions and 23 deletions

View File

@@ -14,6 +14,10 @@
#include "xgboost/data.h"
namespace xgboost {
namespace common {
class ColumnMatrix;
} // namespace common
/*!
* \brief preprocessed global index matrix, in CSR format
*
@@ -80,13 +84,13 @@ class GHistIndexMatrix {
for (bst_uint j = 0; j < inst.size(); ++j) {
auto e = inst[j];
if (common::IsCat(ft, e.index)) {
auto bin_idx = cut.SearchCatBin(e);
bst_bin_t bin_idx = cut.SearchCatBin(e);
index_data[ibegin + j] = get_offset(bin_idx, j);
++hit_count_tloc_[tid * nbins + bin_idx];
} else {
uint32_t idx = cut.SearchBin(e.fvalue, e.index, ptrs, values);
index_data[ibegin + j] = get_offset(idx, j);
++hit_count_tloc_[tid * nbins + idx];
bst_bin_t bin_idx = cut.SearchBin(e.fvalue, e.index, ptrs, values);
index_data[ibegin + j] = get_offset(bin_idx, j);
++hit_count_tloc_[tid * nbins + bin_idx];
}
}
});