#[non_exhaustive]pub struct PerQueryScore {
pub query: String,
pub expected_count: usize,
pub first_hit_rank: Option<usize>,
pub precision_at_k: f64,
pub recall_at_k: f64,
pub ndcg_at_k: f64,
}Expand description
One row of the report — every metric for one query, plus the
rank of the first hit (1-based) or None when none of the
expected ids appeared in the top-K window. expected_count
is preserved so recall- and NDCG-shaped means can correctly
skip queries with empty expected.
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.query: StringQuery text, copied from the input sample for trace output.
expected_count: usize|expected| for this sample — used by aggregators to skip
queries where recall / NDCG would be undefined.
first_hit_rank: Option<usize>1-based rank of the first expected id within the top-K window,
or None if no expected id landed in the window.
precision_at_k: f64|expected ∩ top-K| / k for this query (always defined; 0.0 when k == 0).
recall_at_k: f64|expected ∩ top-K| / |expected| for this query (0.0 when expected is empty).
ndcg_at_k: f64Normalised DCG@K with binary relevance for this query
(0.0 when expected is empty or k == 0).
Trait Implementations§
Source§impl Clone for PerQueryScore
impl Clone for PerQueryScore
Source§fn clone(&self) -> PerQueryScore
fn clone(&self) -> PerQueryScore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more