pub struct ErrorEnvelope {
pub list_idx: u32,
pub quantiles: HashMap<u32, f32>,
pub mean_error: f32,
pub std_error: f32,
pub max_error: f32,
pub min_error: f32,
pub sample_count: u32,
}Expand description
Pre-computed error envelope for a list
Fields§
§list_idx: u32List index
quantiles: HashMap<u32, f32>Quantiles of error distribution Key: quantile (e.g., 0.95, 0.99, 0.999) Value: error bound at that quantile
mean_error: f32Mean error
std_error: f32Standard deviation of error
max_error: f32Maximum observed error
min_error: f32Minimum observed error
sample_count: u32Number of samples used for calibration
Implementations§
Source§impl ErrorEnvelope
impl ErrorEnvelope
Sourcepub fn error_at_quantile(&self, quantile: f32) -> f32
pub fn error_at_quantile(&self, quantile: f32) -> f32
Get error bound for a quantile
Returns ε such that P(error ≤ ε) ≥ quantile
Sourcepub fn safe_true_threshold(&self, proxy: f32, confidence: f32) -> f32
pub fn safe_true_threshold(&self, proxy: f32, confidence: f32) -> f32
Convert proxy threshold to safe true-score threshold
For similarity (higher is better): true_score ≥ proxy - error_bound
Returns threshold such that P(true ≥ threshold | proxy = p) ≥ confidence
Sourcepub fn safe_proxy_threshold(&self, true_threshold: f32, confidence: f32) -> f32
pub fn safe_proxy_threshold(&self, true_threshold: f32, confidence: f32) -> f32
Convert true threshold to safe proxy threshold
For filtering candidates before rerank: proxy ≥ true + error_bound (conservative)
Sourcepub fn definitely_beats(&self, proxy: f32, true_threshold: f32) -> bool
pub fn definitely_beats(&self, proxy: f32, true_threshold: f32) -> bool
Check if proxy score definitely beats true threshold
Trait Implementations§
Source§impl Clone for ErrorEnvelope
impl Clone for ErrorEnvelope
Source§fn clone(&self) -> ErrorEnvelope
fn clone(&self) -> ErrorEnvelope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ErrorEnvelope
impl Debug for ErrorEnvelope
Source§impl Default for ErrorEnvelope
impl Default for ErrorEnvelope
Source§impl<'de> Deserialize<'de> for ErrorEnvelope
impl<'de> Deserialize<'de> for ErrorEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorEnvelope
impl RefUnwindSafe for ErrorEnvelope
impl Send for ErrorEnvelope
impl Sync for ErrorEnvelope
impl Unpin for ErrorEnvelope
impl UnsafeUnpin for ErrorEnvelope
impl UnwindSafe for ErrorEnvelope
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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