Set ndcg to default for LTR. (#8822)

- Add document.
- Add tests.
- Use `ndcg` with `topk` as default.
This commit is contained in:
Jiaming Yuan
2023-06-09 23:31:33 +08:00
committed by GitHub
parent e4dd6051a0
commit 1fcc26a6f8
18 changed files with 842 additions and 19 deletions

View File

@@ -419,6 +419,7 @@ class HistBuilder {
CPUExpandEntry InitRoot(DMatrix *p_fmat, linalg::MatrixView<GradientPair const> gpair,
RegTree *p_tree) {
monitor_->Start(__func__);
CPUExpandEntry node(RegTree::kRoot, p_tree->GetDepth(0));
std::size_t page_id = 0;
@@ -475,12 +476,14 @@ class HistBuilder {
node = entries.front();
}
monitor_->Stop(__func__);
return node;
}
void BuildHistogram(DMatrix *p_fmat, RegTree *p_tree,
std::vector<CPUExpandEntry> const &valid_candidates,
linalg::MatrixView<GradientPair const> gpair) {
monitor_->Start(__func__);
std::vector<CPUExpandEntry> nodes_to_build(valid_candidates.size());
std::vector<CPUExpandEntry> nodes_to_sub(valid_candidates.size());
@@ -508,6 +511,7 @@ class HistBuilder {
nodes_to_sub, gpair.Values());
++page_id;
}
monitor_->Stop(__func__);
}
void UpdatePosition(DMatrix *p_fmat, RegTree const *p_tree,
@@ -525,6 +529,7 @@ class HistBuilder {
std::vector<bst_node_t> *p_out_position) {
monitor_->Start(__func__);
if (!task_->UpdateTreeLeaf()) {
monitor_->Stop(__func__);
return;
}
for (auto const &part : partitioner_) {