Fix CPU hist init for sparse dataset. (#4625)
* Fix CPU hist init for sparse dataset. * Implement sparse histogram cut. * Allow empty features. * Fix windows build, don't use sparse in distributed environment. * Comments. * Smaller threshold. * Fix windows omp. * Fix msvc lambda capture. * Fix MSVC macro. * Fix MSVC initialization list. * Fix MSVC initialization list x2. * Preserve categorical feature behavior. * Rename matrix to sparse cuts. * Reuse UseGroup. * Check for categorical data when adding cut. Co-Authored-By: Philip Hyunsu Cho <chohyu01@cs.washington.edu> * Sanity check. * Fix comments. * Fix comment.
This commit is contained in:
committed by
Philip Hyunsu Cho
parent
b7a1f22d24
commit
d9a47794a5
@@ -28,7 +28,7 @@ TEST(CompressedIterator, Test) {
|
||||
|
||||
CompressedIterator<int> ci(buffer.data(), alphabet_size);
|
||||
std::vector<int> output(input.size());
|
||||
for (int i = 0; i < input.size(); i++) {
|
||||
for (size_t i = 0; i < input.size(); i++) {
|
||||
output[i] = ci[i];
|
||||
}
|
||||
|
||||
@@ -38,12 +38,12 @@ TEST(CompressedIterator, Test) {
|
||||
std::vector<unsigned char> buffer2(
|
||||
CompressedBufferWriter::CalculateBufferSize(input.size(),
|
||||
alphabet_size));
|
||||
for (int i = 0; i < input.size(); i++) {
|
||||
for (size_t i = 0; i < input.size(); i++) {
|
||||
cbw.WriteSymbol(buffer2.data(), input[i], i);
|
||||
}
|
||||
CompressedIterator<int> ci2(buffer.data(), alphabet_size);
|
||||
std::vector<int> output2(input.size());
|
||||
for (int i = 0; i < input.size(); i++) {
|
||||
for (size_t i = 0; i < input.size(); i++) {
|
||||
output2[i] = ci2[i];
|
||||
}
|
||||
ASSERT_TRUE(input == output2);
|
||||
|
||||
Reference in New Issue
Block a user