Educational Playground

Retrieval Evaluation Lab

Calculate ranked-retrieval metrics from explicit relevance judgments, inspect per-query results, and understand the formulas and assumptions.

Processing happens in your browser; no installation, account, or API key is required.

Rankings and relevance

Edit the JSON input. Ranked documents without a relevance label are treated as non-relevant and counted in the output.

Metric definitions and assumptions
  • Precision@K = relevant retrieved / K; unfilled ranks count as non-relevant.
  • Recall@K = relevant retrieved / all positively judged documents.
  • MRR averages reciprocal rank across every query; queries without relevant judgments contribute zero.
  • DCG@K = Σ (2^grade − 1) / log₂(rank + 1); NDCG@K divides by the ideal DCG from supplied positive grades.
  • MAP averages precision at each relevant rank, divided by the number of positively judged documents; no-positive queries contribute zero.
  • Duplicate ranked IDs keep their first occurrence. Unjudged documents receive relevance zero, so complete judgments matter for interpretation. These metrics do not measure complete RAG quality.

Related reading

Back to all tools