#[non_exhaustive]pub struct ScoreStats {
pub count: usize,
pub mean: f64,
pub variance: f64,
pub std_dev: f64,
pub min: f64,
pub max: f64,
}Expand description
Statistics of one criterion’s score across runs.
§Example
use adk_eval::ScoreStats;
let stats = ScoreStats::from_scores(&[1.0, 0.5, 0.0]).unwrap();
assert_eq!(stats.mean, 0.5);
assert_eq!(stats.variance, 0.25); // sample variance, n - 1 in the denominator
assert_eq!(stats.std_dev, 0.5);
assert!(ScoreStats::from_scores(&[]).is_none());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.count: usizeRuns in which the criterion was scored.
mean: f64Arithmetic mean.
variance: f64Sample variance, with count - 1 in the denominator; 0.0 for a single score.
std_dev: f64Square root of the variance.
min: f64Lowest score.
max: f64Highest score.
Implementations§
Source§impl ScoreStats
impl ScoreStats
Sourcepub fn from_scores(scores: &[f64]) -> Option<Self>
pub fn from_scores(scores: &[f64]) -> Option<Self>
Computes the statistics of scores, or None when there are none.
Trait Implementations§
Source§impl Clone for ScoreStats
impl Clone for ScoreStats
Source§impl Debug for ScoreStats
impl Debug for ScoreStats
Source§impl<'de> Deserialize<'de> for ScoreStats
impl<'de> Deserialize<'de> for ScoreStats
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
Source§impl PartialEq for ScoreStats
impl PartialEq for ScoreStats
Source§impl Serialize for ScoreStats
impl Serialize for ScoreStats
impl StructuralPartialEq for ScoreStats
Auto Trait Implementations§
impl Forget for ScoreStats
impl Freeze for ScoreStats
impl Move for ScoreStats
impl RefUnwindSafe for ScoreStats
impl Send for ScoreStats
impl Sync for ScoreStats
impl Unpin for ScoreStats
impl UnsafeUnpin for ScoreStats
impl UnwindSafe for ScoreStats
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