reciprocal_rank_fusion#

scikitplot.mcp.reciprocal_rank_fusion(ranked_lists, *, k=60, key=<function _chunk_key>)[source]#

Fuse weighted ranked lists into a single key -> score map.

Parameters:
ranked_listssequence of (weight, items)

Each leg’s weight and its best-first ranked items.

kint, optional

RRF constant, an int of at least 1 (default DEFAULT_RRF_K).

keycallable, optional

Maps an item to its fusion identity, a non-empty str (default _chunk_key).

Returns:
dict

identity -> fused score (higher is better), in fused order: descending score, ties by ascending identity.

Raises:
TypeError

If k or a weight has the wrong type, or key returns a non-str.

ValueError

If k < 1, a weight is negative or not finite, or an identity is empty.

Parameters:
Return type:

dict[str, float]

Notes

R2-1: a thin adapter over FusionPolicy, the rule shared byte for byte with scikitplot.corpus. Each leg is named by its position, so legs of equal weight stay distinct. The per-leg contributions the contract returns are not carried: an MCP result is a RetrievedChunk, which has no field for them.