Data Science – What Is Recall@k ?
Table Of Contents:
- What Is Recall@k ?
- Example Of Recall@k .
- Where It Is Being Used ?
- Pro & Cons Of Recall@k
- Python Example Of Recall@k.
(1) What Is Recall@k?
(2) Example Of Recall@k?
(3) Interpretation Of Recall@k?
(4) Where Recall@k Is Being Used ?
(5) Pro & Con Of Recall@k .
(6) When To Use Recall@k ?
(7) Python Implementation Of Recall@k ?
pip install rank-eval
from rankeval.metrics import Recall
# predicted rankings per query (query_id: [doc_ids])
y_pred = {
"q1": ["d2", "d1", "d3"],
"q2": ["d5", "d7", "d9"]
}
# relevant ground truths (query_id: set of relevant doc_ids)
y_true = {
"q1": {"d1", "d3"},
"q2": {"d7"}
}
recall = Recall(k=2)
print(f"Recall@2: {recall.eval(y_pred, y_true):.2f}")

