pub struct RrfConfig {
pub k: u32,
pub top_k: Option<usize>,
}Expand description
RRF configuration.
§Example
use rankops::RrfConfig;
let config = RrfConfig::default()
.with_k(60)
.with_top_k(10);Fields§
§k: u32Smoothing constant (default: 60).
Must be >= 1 to avoid division by zero in the RRF formula. Values < 1 will cause panics during fusion.
top_k: Option<usize>Maximum results to return (None = all).
Implementations§
Source§impl RrfConfig
impl RrfConfig
Sourcepub fn with_k(self, k: u32) -> Self
pub fn with_k(self, k: u32) -> Self
Set the k parameter (smoothing constant).
k=60— Standard RRF, works well for most casesk=1— Top positions dominate heavilyk=100+— More uniform contribution across ranks
§Panics
Panics if k == 0 (would cause division by zero in RRF formula).
Sourcepub const fn with_top_k(self, top_k: usize) -> Self
pub const fn with_top_k(self, top_k: usize) -> Self
Limit output to top_k results.
Trait Implementations§
impl Copy for RrfConfig
impl Eq for RrfConfig
impl StructuralPartialEq for RrfConfig
Auto Trait Implementations§
impl Freeze for RrfConfig
impl RefUnwindSafe for RrfConfig
impl Send for RrfConfig
impl Sync for RrfConfig
impl Unpin for RrfConfig
impl UnsafeUnpin for RrfConfig
impl UnwindSafe for RrfConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more