Skip to main content

mnemonist_evals/
lib.rs

1//! Evaluation metrics and harness for mnemonist.
2//!
3//! - [`search`] — retrieval quality (MRR, NDCG, precision@k, recall@k)
4//! - [`embedding`] — embedding space quality (anisotropy, discrimination gap, intrinsic dimensionality)
5//! - [`quantization`] — quantization fidelity (MSE, cosine distortion, recall impact)
6//! - [`dataset`] — synthetic benchmark dataset generation
7//! - [`harness`] — end-to-end eval runner producing structured reports
8
9pub mod dataset;
10pub mod embedding;
11pub mod harness;
12pub mod report;
13pub mod search;
14
15#[cfg(feature = "quant")]
16pub mod quantization;
17
18pub use report::EvalReport;
19
20#[derive(Debug, thiserror::Error)]
21pub enum EvalError {
22    #[error("insufficient data: need at least {min}, got {got}")]
23    InsufficientData { min: usize, got: usize },
24
25    #[error("dimension mismatch: expected {expected}, got {got}")]
26    DimensionMismatch { expected: usize, got: usize },
27
28    #[error("quantization error: {0}")]
29    #[cfg(feature = "quant")]
30    Quant(#[from] mnemonist_quant::QuantError),
31
32    #[error("{0}")]
33    Other(String),
34}