13/31
Part 4 of 6 · Yes-or-no metricsLearn and do

Precision, recall, MRR and MAP need yes-or-no labels

NDCG uses graded relevance. Four other common metrics need a plain yes or no.

First decide which items count as relevant

rel = relevant(shown, 2)
print(rel)
Predict

Relevant means grade 2 or more. What is rel for [2, 3, 0, 1, 2, 3]?

Pick one to see what it prints.
Pick an answer above to see the rest
Predict

4 relevant items in all, and 3 of them in the top 5. What are precision@5 and recall@5?

Pick one to see what it prints.
Pick an answer above to see the rest