#[non_exhaustive]pub struct RecallReport {
pub k: usize,
pub per_query: Vec<PerQueryScore>,
}Expand description
Per-query trace plus aggregate metrics computed across the scored sample slice.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.k: usizeTop-K window used for every per-query metric.
per_query: Vec<PerQueryScore>One PerQueryScore per input sample, in input order.
Implementations§
Source§impl RecallReport
impl RecallReport
Sourcepub fn hit_rate(&self) -> f64
pub fn hit_rate(&self) -> f64
Fraction of queries where any expected id appeared in the
top-K. 0.0 when there are no queries.
Sourcepub fn mean_reciprocal_rank(&self) -> f64
pub fn mean_reciprocal_rank(&self) -> f64
Mean of 1 / rank of the first expected hit across all
queries. Non-hits contribute 0. 0.0 when there are no
queries.
Sourcepub fn mean_precision_at_k(&self) -> f64
pub fn mean_precision_at_k(&self) -> f64
Mean precision@K across all queries. 0.0 when there are
no queries.
Sourcepub fn mean_recall_at_k(&self) -> f64
pub fn mean_recall_at_k(&self) -> f64
Mean recall@K across queries with at least one expected
id. Queries with empty expected are excluded from the
denominator — recall is undefined when there is nothing
to retrieve. 0.0 when no query qualifies.
Sourcepub fn mean_ndcg_at_k(&self) -> f64
pub fn mean_ndcg_at_k(&self) -> f64
Mean NDCG@K across queries with at least one expected id.
Same skip rule as Self::mean_recall_at_k — NDCG is
undefined when ideal DCG is zero. 0.0 when no query
qualifies.
Trait Implementations§
Source§impl Clone for RecallReport
impl Clone for RecallReport
Source§fn clone(&self) -> RecallReport
fn clone(&self) -> RecallReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more