[metric] Evaluate ndcg, map and pre without a cutoff over the whole list #12794
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 290 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.339
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12794"
general
weight: 0.35
RAMitchell
With
eval_metric="ndcg","map"or"pre", the score only covers the top 32 documents of each query. The name has no@n, and the docs describe@nas the way to cut off the list.EvalRanksets a pair method only when@nis given. Otherwise it keeps thetopkdefault (since #8984), andTopK()falls back toDefaultK(), which is 32. Lists of up to 32 documents are not affected.The same name also means the whole list elsewhere: with
lambdarank_pair_method="mean", the objective reports its default metric asndcgand passes that pair method along, soTopK()is unbounded.| |
ndcg|ndcg@32|ndcg@100||---|---|---|---|
|
master| 0.83272 | 0.83272 | 0.945334 || this PR | 0.945334 | 0.83272 | 0.945334 |
This PR uses the
meanpair method for these metrics when no cutoff is given, which makesTopK()unbounded. Only the metric's own parameter changes, so training is not affected. The default metric of thetopkobjectives is stillndcg@32.This does change the reported value of plain
ndcg,mapandpreon queries with more than 32 documents, which also affects early stopping on them. Anyone who wants the old value can ask for@32.The cutoff regression is folded into the existing shared C++ precision, NDCG and MAP checks using fixed predictions for a 64-document query. The existing NDCG JSON test checks objective default metric configuration. All seven selected local/distributed CPU cases fail without the fix and pass with it; applicable pre-commit hooks pass. The shared helpers also run in CUDA builds, but GPU execution was not run locally.
Previously reported macOS CPU validation:
test_ranking.py,test_eval_metrics.py,test_early_stopping.py,test_callback.py, the ranker tests intest_with_sklearn.pyand the metric, ranking and learner gtests pass on macOS CPU. I did not run the GPU path.