mlprep
mlprep/ML Breadthmedium10 min

Explain NDCG. Why use it over AUC for a ranking problem, and what does it actually measure about your ranker?

formulate your answer, then —

tldr

NDCG@k = DCG@k / IDCG@k. DCG discounts relevance by log₂(position+1) — item at position 1 worth full relevance, position 10 worth ~29%. Normalization by ideal ranking makes it comparable across queries. Use NDCG for ranking when relevance is graded and top-k quality matters. AUC measures pairwise ordering but ignores position — wrong metric for search/recommendation.

follow-up

  • How would you compute NDCG when you only have implicit feedback (clicks) instead of explicit relevance labels?
  • What's the difference between NDCG@10 and NDCG@100 and when do you care about each?
  • Your NDCG improves in offline eval but A/B test shows no engagement lift. What do you investigate first?