NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Senior2 views

How do you calculate Precision, and how does it differ from Recall?

Practice

Asked at

AI answer

Precision is the proportion of relevant results among all retrieved results. For search: Precision@k = number of relevant documents in the top k / k. Recall is the proportion of retrieved relevant results among all relevant results: Recall@k = number of relevant documents in the top k / total number of relevant documents. High Precision means few irrelevant results; high Recall means few relevant results are missed. The trade-off between them usually depends on the task.