Accept histogram cut instead gradient index in evaluation. (#7336)

This commit is contained in:
Jiaming Yuan
2021-10-20 18:04:46 +08:00
committed by GitHub
parent 15685996fc
commit 8d7c6366d7
4 changed files with 13 additions and 11 deletions

View File

@@ -13,7 +13,8 @@ TEST(GradientIndex, ExternalMemory) {
std::unique_ptr<DMatrix> dmat = CreateSparsePageDMatrix(10000);
std::vector<size_t> base_rowids;
std::vector<float> hessian(dmat->Info().num_row_, 1);
for (auto const& page : dmat->GetBatches<GHistIndexMatrix>({0, 64, hessian})) {
for (auto const &page : dmat->GetBatches<GHistIndexMatrix>(
{GenericParameter::kCpuId, 64, hessian})) {
base_rowids.push_back(page.base_rowid);
}
size_t i = 0;

View File

@@ -58,7 +58,7 @@ template <typename GradientSumT> void TestEvaluateSplits() {
entries.front().depth = 0;
evaluator.InitRoot(GradStats{total_gpair});
evaluator.EvaluateSplits(hist, gmat, tree, &entries);
evaluator.EvaluateSplits(hist, gmat.cut, tree, &entries);
auto best_loss_chg =
evaluator.Evaluator().CalcSplitGain(