Skip to content

Commit 2abf782

Browse files
committed
rigorous.
1 parent f5cf2b7 commit 2abf782

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/metric/rank_metric.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class EvalPrecision : public EvalRankWithCache<ltr::MAPCache> {
330330

331331
common::ParallelFor(p_cache->Groups(), ctx_->Threads(), [&](auto g) {
332332
auto g_label = h_label.Slice(linalg::Range(gptr[g], gptr[g + 1]));
333-
auto g_rank = rank_idx.subspan(gptr[g]);
333+
auto g_rank = rank_idx.subspan(gptr[g], gptr[g + 1] - gptr[g]);
334334

335335
auto n = std::min(static_cast<std::size_t>(param_.TopK()), g_label.Size());
336336
double n_hits{0.0};
@@ -438,7 +438,7 @@ class EvalMAPScore : public EvalRankWithCache<ltr::MAPCache> {
438438

439439
common::ParallelFor(p_cache->Groups(), ctx_->Threads(), [&](auto g) {
440440
auto g_label = h_label.Slice(linalg::Range(gptr[g], gptr[g + 1]));
441-
auto g_rank = rank_idx.subspan(gptr[g]);
441+
auto g_rank = rank_idx.subspan(gptr[g], gptr[g + 1] - gptr[g]);
442442

443443
auto n = std::min(static_cast<std::size_t>(param_.TopK()), g_label.Size());
444444
double n_hits{0.0};

0 commit comments

Comments
 (0)