pub struct RunningStatistics<S>where
S: Dimension + RemoveAxis,{ /* private fields */ }Expand description
A container to keep track of sufficient statistics of an arbitrary
shape ndarray
§Type parameters
S: The shape of the array
Implementations§
Source§impl<S> RunningStatistics<S>where
S: Dimension + RemoveAxis,
impl<S> RunningStatistics<S>where
S: Dimension + RemoveAxis,
pub fn add<V>(&mut self, xx: &ArrayBase<V, S>)
pub fn add_element<I>(&mut self, idx: &I, val: f32)
pub fn clear(&mut self)
Sourcepub fn count_positives(&self) -> ArrayBase<OwnedRepr<f32>, S>
pub fn count_positives(&self) -> ArrayBase<OwnedRepr<f32>, S>
Frequency of positive values. For a sparse count matrix, this will reflect the number of non-zero values
pub fn shape(&self) -> &[usize]
Sourcepub fn save(
&self,
filename: &str,
names: &[Box<str>],
sep: &str,
row_column_name: Option<&str>,
) -> Result<()>
pub fn save( &self, filename: &str, names: &[Box<str>], sep: &str, row_column_name: Option<&str>, ) -> Result<()>
Save the statistics to a file
§Arguments
filename- The name of the file to save the statistics tonames- The names of the statisticssep- Separator for text formatsrow_column_name- Name for the row column in parquet format (defaults to “stat”)
pub fn to_string_vec( &self, names: &[Box<str>], sep: &str, ) -> Result<Vec<Box<str>>>
Trait Implementations§
Source§impl<S> Clone for RunningStatistics<S>
impl<S> Clone for RunningStatistics<S>
Source§impl<S> RunningStatOps<f32> for RunningStatistics<S>where
S: Dimension + RemoveAxis,
impl<S> RunningStatOps<f32> for RunningStatistics<S>where
S: Dimension + RemoveAxis,
Auto Trait Implementations§
impl<S> Freeze for RunningStatistics<S>
impl<S> RefUnwindSafe for RunningStatistics<S>
impl<S> Send for RunningStatistics<S>
impl<S> Sync for RunningStatistics<S>
impl<S> Unpin for RunningStatistics<S>
impl<S> UnsafeUnpin for RunningStatistics<S>
impl<S> UnwindSafe for RunningStatistics<S>
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.