pub struct TensorStats {
pub mean: f64,
pub std: f64,
pub min: f64,
pub max: f64,
pub p25: f64,
pub p50: f64,
pub p75: f64,
pub nan_count: usize,
pub inf_count: usize,
pub element_count: usize,
}Expand description
Summary statistics for a tensor.
Fields§
§mean: f64Arithmetic mean of finite values.
std: f64Population standard deviation of finite values.
min: f64Minimum finite value.
max: f64Maximum finite value.
p25: f6425th percentile.
p50: f6450th percentile (median).
p75: f6475th percentile.
nan_count: usizeNumber of NaN values.
inf_count: usizeNumber of Inf values (positive or negative).
element_count: usizeTotal number of elements.
Implementations§
Source§impl TensorStats
impl TensorStats
Sourcepub fn compute(data: &[f64]) -> Result<Self, StatsError>
pub fn compute(data: &[f64]) -> Result<Self, StatsError>
Compute statistics from a slice of f64 values.
NaN and Inf values are counted but excluded from statistical calculations.
Sourcepub fn has_anomalies(&self) -> bool
pub fn has_anomalies(&self) -> bool
Whether any NaN or Inf values are present.
Trait Implementations§
Source§impl Clone for TensorStats
impl Clone for TensorStats
Source§fn clone(&self) -> TensorStats
fn clone(&self) -> TensorStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TensorStats
impl RefUnwindSafe for TensorStats
impl Send for TensorStats
impl Sync for TensorStats
impl Unpin for TensorStats
impl UnsafeUnpin for TensorStats
impl UnwindSafe for TensorStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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