Skip to main content

rrf_max_possible

Function rrf_max_possible 

Source
pub fn rrf_max_possible(weights: &[f64], rrf_k: f64) -> f64
Expand description

Compute the theoretical maximum RRF score for a given set of weights and rrf_k.

Useful for normalising rrf_fuse scores to [0, 1]:

use sqlite_graphrag::storage::fusion::{rrf_fuse, rrf_max_possible};

let weights = vec![1.0_f64, 1.0_f64];
let max = rrf_max_possible(&weights, 60.0);
assert!(max > 0.0);