Refactor for GHistIndex. (#7923)

* Pass sparse page as adapter, which prepares for quantile dmatrix.
* Remove old external memory code like `rbegin` and extra `Init` function.
* Simplify type dispatch.
This commit is contained in:
Jiaming Yuan
2022-05-23 23:04:53 +08:00
committed by GitHub
parent d314680a15
commit 18a38f7ca0
6 changed files with 113 additions and 157 deletions

View File

@@ -44,9 +44,7 @@ TEST(GradientIndex, FromCategoricalBasic) {
h_ft.resize(kCols, FeatureType::kCategorical);
BatchParam p(max_bins, 0.8);
GHistIndexMatrix gidx;
gidx.Init(m.get(), max_bins, p.sparse_thresh, false, common::OmpGetNumThreads(0), {});
GHistIndexMatrix gidx(m.get(), max_bins, p.sparse_thresh, false, common::OmpGetNumThreads(0), {});
auto x_copy = x;
std::sort(x_copy.begin(), x_copy.end());