Fix and cleanup for column matrix. (#7901)

* Fix missed type dispatching for dense columns with missing values.
* Code cleanup to reduce special cases.
* Reduce memory usage.
This commit is contained in:
Jiaming Yuan
2022-05-16 21:11:50 +08:00
committed by GitHub
parent 1496789561
commit 4fcfd9c96e
10 changed files with 124 additions and 136 deletions

View File

@@ -130,7 +130,6 @@ TEST_F(TestPartitionBasedSplit, CPUHist) {
namespace {
auto CompareOneHotAndPartition(bool onehot) {
int static constexpr kRows = 128, kCols = 1;
using GradientSumT = double;
std::vector<FeatureType> ft(kCols, FeatureType::kCategorical);
TrainParam param;

View File

@@ -35,7 +35,7 @@ TEST(QuantileHist, Partitioner) {
for (auto const& page : Xy->GetBatches<SparsePage>()) {
GHistIndexMatrix gmat;
gmat.Init(page, {}, cuts, 64, false, 0.5, ctx.Threads());
gmat.Init(page, {}, cuts, 64, true, 0.5, ctx.Threads());
bst_feature_t const split_ind = 0;
common::ColumnMatrix column_indices;
column_indices.Init(page, gmat, 0.5, ctx.Threads());