pub struct WeightedConfig {
pub weight_a: f32,
pub weight_b: f32,
pub normalize: bool,
pub top_k: Option<usize>,
}Expand description
Weighted fusion configuration.
§Example
use rankops::WeightedConfig;
let config = WeightedConfig::default()
.with_weights(0.7, 0.3)
.with_normalize(true)
.with_top_k(10);Fields§
§weight_a: f32Weight for first list (default: 0.5).
weight_b: f32Weight for second list (default: 0.5).
normalize: boolNormalize scores to [0,1] before combining (default: true).
top_k: Option<usize>Maximum results to return (None = all).
Implementations§
Source§impl WeightedConfig
impl WeightedConfig
Sourcepub const fn with_weights(self, weight_a: f32, weight_b: f32) -> Self
pub const fn with_weights(self, weight_a: f32, weight_b: f32) -> Self
Set weights for the two lists.
Sourcepub const fn with_normalize(self, normalize: bool) -> Self
pub const fn with_normalize(self, normalize: bool) -> Self
Enable/disable score normalization.
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§
Source§impl Clone for WeightedConfig
impl Clone for WeightedConfig
Source§fn clone(&self) -> WeightedConfig
fn clone(&self) -> WeightedConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WeightedConfig
impl Debug for WeightedConfig
Source§impl Default for WeightedConfig
impl Default for WeightedConfig
Source§impl PartialEq for WeightedConfig
impl PartialEq for WeightedConfig
impl Copy for WeightedConfig
impl StructuralPartialEq for WeightedConfig
Auto Trait Implementations§
impl Freeze for WeightedConfig
impl RefUnwindSafe for WeightedConfig
impl Send for WeightedConfig
impl Sync for WeightedConfig
impl Unpin for WeightedConfig
impl UnsafeUnpin for WeightedConfig
impl UnwindSafe for WeightedConfig
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