transformer_rankers.eval.evaluation.recall_at_with_k_candidates

transformer_rankers.eval.evaluation.recall_at_with_k_candidates(preds, labels, k, at)[source]

Calculates recall with k candidates. labels list must be sorted by relevance.

Parameters
  • preds – float list containing the predictions.

  • labels – float list containing the relevance labels.

  • k – number of candidates to consider.

  • at – threshold to cut the list.

Returns: float containing Recall_k@at