Skip to main content

weighted

Function weighted 

Source
pub fn weighted<I: Clone + Eq + Hash>(
    results_a: &[(I, f32)],
    results_b: &[(I, f32)],
    config: WeightedConfig,
) -> Vec<(I, f32)>
Expand description

Weighted score fusion with configurable retriever trust.

Formula: score(d) = w_a × norm(s_a) + w_b × norm(s_b)

Use when you know one retriever is more reliable for your domain. Weights are normalized to sum to 1.

§Complexity

O(n log n) where n = total items across all lists.