pub struct ScoringConfig {
pub primary: String,
pub additional: Vec<String>,
pub confidence_intervals: bool,
pub confidence_level: f64,
pub n_bootstrap: usize,
pub random_state: Option<u64>,
pub scorer_registry: ScorerRegistry,
}Expand description
Enhanced scoring configuration
Fields§
§primary: StringPrimary scoring metric
additional: Vec<String>Additional metrics to compute
confidence_intervals: boolWhether to compute confidence intervals
confidence_level: f64Confidence level for intervals (0.95 = 95%)
n_bootstrap: usizeNumber of bootstrap samples for confidence intervals
random_state: Option<u64>Random state for bootstrap sampling
scorer_registry: ScorerRegistryCustom scorer registry
Implementations§
Source§impl ScoringConfig
impl ScoringConfig
Sourcepub fn with_additional_metrics(self, metrics: Vec<String>) -> Self
pub fn with_additional_metrics(self, metrics: Vec<String>) -> Self
Add additional metrics
Sourcepub fn with_confidence_intervals(self, level: f64, n_bootstrap: usize) -> Self
pub fn with_confidence_intervals(self, level: f64, n_bootstrap: usize) -> Self
Enable confidence intervals
Sourcepub fn with_random_state(self, random_state: u64) -> Self
pub fn with_random_state(self, random_state: u64) -> Self
Set random state for reproducibility
Sourcepub fn with_custom_scorer(self, scorer: Arc<dyn CustomScorer>) -> Self
pub fn with_custom_scorer(self, scorer: Arc<dyn CustomScorer>) -> Self
Register a custom scorer
Sourcepub fn with_closure_scorer<F>(
self,
name: String,
scorer_fn: F,
higher_is_better: bool,
) -> Self
pub fn with_closure_scorer<F>( self, name: String, scorer_fn: F, higher_is_better: bool, ) -> Self
Register a custom scorer from a closure
Sourcepub fn scorer_registry_mut(&mut self) -> &mut ScorerRegistry
pub fn scorer_registry_mut(&mut self) -> &mut ScorerRegistry
Get a mutable reference to the scorer registry
Sourcepub fn scorer_registry(&self) -> &ScorerRegistry
pub fn scorer_registry(&self) -> &ScorerRegistry
Get a reference to the scorer registry
Trait Implementations§
Source§impl Clone for ScoringConfig
impl Clone for ScoringConfig
Source§fn clone(&self) -> ScoringConfig
fn clone(&self) -> ScoringConfig
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 ScoringConfig
impl Debug for ScoringConfig
Auto Trait Implementations§
impl Freeze for ScoringConfig
impl !RefUnwindSafe for ScoringConfig
impl Send for ScoringConfig
impl Sync for ScoringConfig
impl Unpin for ScoringConfig
impl !UnwindSafe for ScoringConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more