Combine multiple ranked lists into a single ranked list using Reciprocal Rank Fusion (RRF).
Signature: def rrf(rankings: list, k: int = 60) -> list
rankings is a list of ranked lists, each containing doc IDs (most-relevant first).d: score(d) = sum over rankers of 1 / (k + rank_i(d)) using 1-indexed ranks.Math
Asked at
import numpy as np
def rrf(...):
pass
Premium problem
Free accounts include problems #1–20. Upgrade to unlock the editor, hidden test cases, and reference solutions for every problem.
Already premium?