Normalized Discounted Cumulative Gain (NDCG)
NDCG
NDCG is an evaluation metric for ranked retrieval that handles graded relevance judgments (not just binary relevant/non-relevant). It measures how well the ranking places highly relevant documents at the top.
DCG and NDCG
where:
- — relevance grade of the document at position
- — ideal DCG (DCG of the perfect ranking)
- NDCG ∈ [0, 1], where 1 = perfect ranking
What It Captures
- Graded relevance: A doc with relevance 3 is worth more than relevance 1 (exponential gain: )
- Position discount: Higher-ranked results matter more ( decay)
- Normalization: Dividing by IDCG makes scores comparable across queries
Comparison with Other Metrics
| Metric | Graded? | Position-aware? | Normalized? |
|---|---|---|---|
| Precision | ❌ Binary | ❌ | ❌ |
| Precision at K | ❌ Binary | Partially (cutoff) | ❌ |
| MAP | ❌ Binary | ✅ | ✅ |
| NDCG | ✅ Graded | ✅ | ✅ |