Struct ndarray_stats::histogram::strategies::Rice
source · pub struct Rice<T> { /* private fields */ }
Expand description
A strategy that does not take variability into account, only data size. Commonly overestimates number of bins required.
Let n
be the number of observations and n_bins
be the number of bins.
n_bins
= 2n
1/3
n_bins
is only proportional to cube root of n
. It tends to overestimate
the n_bins
and it does not take into account data variability.
§Notes
This strategy requires the data
- not being empty
- not being constant
Implementations§
Trait Implementations§
source§impl<T> BinsBuildingStrategy for Rice<T>
impl<T> BinsBuildingStrategy for Rice<T>
source§fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError>
fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError>
Returns Err(BinsBuildError::Strategy)
if the array is constant.
Returns Err(BinsBuildError::EmptyInput)
if a.len()==0
.
Returns Ok(Self)
otherwise.
type Elem = T
Auto Trait Implementations§
impl<T> Freeze for Rice<T>where
T: Freeze,
impl<T> RefUnwindSafe for Rice<T>where
T: RefUnwindSafe,
impl<T> Send for Rice<T>where
T: Send,
impl<T> Sync for Rice<T>where
T: Sync,
impl<T> Unpin for Rice<T>where
T: Unpin,
impl<T> UnwindSafe for Rice<T>where
T: UnwindSafe,
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> 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