pub enum FusionMethod {
Rrf {
k: u32,
},
Isr {
k: u32,
},
CombSum,
CombMnz,
Borda,
Weighted {
weight_a: f32,
weight_b: f32,
normalize: bool,
},
Dbsf,
Standardized {
clip_range: (f32, f32),
},
AdditiveMultiTask {
weight_a: f32,
weight_b: f32,
normalization: Normalization,
},
}Expand description
Unified fusion method for dispatching to different algorithms.
Provides a single entry point for all fusion algorithms with a consistent API.
§Example
use rankops::FusionMethod;
let sparse = vec![("d1", 10.0), ("d2", 8.0)];
let dense = vec![("d2", 0.9), ("d3", 0.7)];
// Use RRF (rank-based, score-agnostic)
let fused = FusionMethod::Rrf { k: 60 }.fuse(&sparse, &dense);
// Use CombSUM (score-based)
let fused = FusionMethod::CombSum.fuse(&sparse, &dense);Variants§
Rrf
Reciprocal Rank Fusion (ignores scores, uses rank position).
Isr
Inverse Square Root rank fusion (gentler decay than RRF).
CombSum
CombSUM — sum of normalized scores.
CombMnz
CombMNZ — sum × overlap count.
Borda
Borda count — N - rank points.
Weighted
Weighted combination with custom weights.
Fields
Dbsf
Distribution-Based Score Fusion (z-score normalization).
Standardized
Standardization-based fusion (ERANK-style).
Uses z-score normalization (standardization) instead of min-max normalization, then applies additive fusion. More robust to outliers and different score distributions. Based on ERANK (arXiv:2509.00520) which shows 2-5% NDCG improvement over CombSUM when score distributions differ significantly.
AdditiveMultiTask
Additive multi-task fusion (ResFlow-style).
Additive fusion of multi-task scores: α·score_a + β·score_b.
ResFlow (arXiv:2411.09705) shows additive outperforms multiplicative for e-commerce.
Implementations§
Source§impl FusionMethod
impl FusionMethod
Sourcepub const fn rrf_with_k(k: u32) -> Self
pub const fn rrf_with_k(k: u32) -> Self
Create RRF method with custom k.
Sourcepub const fn isr_with_k(k: u32) -> Self
pub const fn isr_with_k(k: u32) -> Self
Create ISR method with custom k.
Sourcepub const fn weighted(weight_a: f32, weight_b: f32) -> Self
pub const fn weighted(weight_a: f32, weight_b: f32) -> Self
Create weighted method with custom weights.
Sourcepub const fn standardized(clip_range: (f32, f32)) -> Self
pub const fn standardized(clip_range: (f32, f32)) -> Self
Create standardized fusion method (ERANK-style).
Uses z-score normalization (standardization) with clipping to prevent outliers. More robust than min-max when score distributions differ significantly.
Sourcepub const fn standardized_default() -> Self
pub const fn standardized_default() -> Self
Create standardized fusion method with default clipping [-3.0, 3.0].
Sourcepub const fn additive_multi_task(weight_a: f32, weight_b: f32) -> Self
pub const fn additive_multi_task(weight_a: f32, weight_b: f32) -> Self
Create additive multi-task fusion method (ResFlow-style).
Additive fusion outperforms multiplicative for e-commerce ranking.
ResFlow’s optimal formula: CTR + CTCVR × 20.
Sourcepub fn additive_multi_task_with_norm(
weight_a: f32,
weight_b: f32,
normalization: Normalization,
) -> Self
pub fn additive_multi_task_with_norm( weight_a: f32, weight_b: f32, normalization: Normalization, ) -> Self
Create additive multi-task fusion with custom normalization.
Trait Implementations§
Source§impl Clone for FusionMethod
impl Clone for FusionMethod
Source§fn clone(&self) -> FusionMethod
fn clone(&self) -> FusionMethod
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more