Trait ndarray_stats::histogram::strategies::BinsBuildingStrategy [−][src]
A trait implemented by all strategies to build Bins
with parameters inferred from observations.
A BinsBuildingStrategy
is required by GridBuilder
to know how to build a Grid
’s projections on the
coordinate axes.
Associated Types
Loading content...Required methods
fn from_array<S>(array: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError> where
S: Data<Elem = Self::Elem>,
Self: Sized,
[src]
S: Data<Elem = Self::Elem>,
Self: Sized,
Given some observations in a 1-dimensional array it returns a BinsBuildingStrategy
that has learned the required parameter to build a collection of Bins
.
It returns Err
if it is not possible to build a collection of
Bins
given the observed data according to the chosen strategy.
fn build(&self) -> Bins<Self::Elem>
[src]
Returns a Bins
instance, built accordingly to the parameters
inferred from observations in from_array
.
fn n_bins(&self) -> usize
[src]
Returns the optimal number of bins, according to the parameters
inferred from observations in from_array
.
Implementors
impl<T> BinsBuildingStrategy for Auto<T> where
T: Ord + Clone + FromPrimitive + NumOps + Zero,
[src]
T: Ord + Clone + FromPrimitive + NumOps + Zero,
type Elem = T
fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError> where
S: Data<Elem = Self::Elem>,
[src]
S: Data<Elem = Self::Elem>,
Returns Err(BinsBuildError::Strategy)
if IQR==0
.
Returns Err(BinsBuildError::EmptyInput)
if a.len()==0
.
Returns Ok(Self)
otherwise.
fn build(&self) -> Bins<T>
[src]
fn n_bins(&self) -> usize
[src]
impl<T> BinsBuildingStrategy for FreedmanDiaconis<T> where
T: Ord + Clone + FromPrimitive + NumOps + Zero,
[src]
T: Ord + Clone + FromPrimitive + NumOps + Zero,
type Elem = T
fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError> where
S: Data<Elem = Self::Elem>,
[src]
S: Data<Elem = Self::Elem>,
Returns Err(BinsBuildError::Strategy)
if IQR==0
.
Returns Err(BinsBuildError::EmptyInput)
if a.len()==0
.
Returns Ok(Self)
otherwise.
fn build(&self) -> Bins<T>
[src]
fn n_bins(&self) -> usize
[src]
impl<T> BinsBuildingStrategy for Rice<T> where
T: Ord + Clone + FromPrimitive + NumOps + Zero,
[src]
T: Ord + Clone + FromPrimitive + NumOps + Zero,
type Elem = T
fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError> where
S: Data<Elem = Self::Elem>,
[src]
S: Data<Elem = Self::Elem>,
Returns Err(BinsBuildError::Strategy)
if the array is constant.
Returns Err(BinsBuildError::EmptyInput)
if a.len()==0
.
Returns Ok(Self)
otherwise.
fn build(&self) -> Bins<T>
[src]
fn n_bins(&self) -> usize
[src]
impl<T> BinsBuildingStrategy for Sqrt<T> where
T: Ord + Clone + FromPrimitive + NumOps + Zero,
[src]
T: Ord + Clone + FromPrimitive + NumOps + Zero,
type Elem = T
fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError> where
S: Data<Elem = Self::Elem>,
[src]
S: Data<Elem = Self::Elem>,
Returns Err(BinsBuildError::Strategy)
if the array is constant.
Returns Err(BinsBuildError::EmptyInput)
if a.len()==0
.
Returns Ok(Self)
otherwise.
fn build(&self) -> Bins<T>
[src]
fn n_bins(&self) -> usize
[src]
impl<T> BinsBuildingStrategy for Sturges<T> where
T: Ord + Clone + FromPrimitive + NumOps + Zero,
[src]
T: Ord + Clone + FromPrimitive + NumOps + Zero,
type Elem = T
fn from_array<S>(a: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError> where
S: Data<Elem = Self::Elem>,
[src]
S: Data<Elem = Self::Elem>,
Returns Err(BinsBuildError::Strategy)
if the array is constant.
Returns Err(BinsBuildError::EmptyInput)
if a.len()==0
.
Returns Ok(Self)
otherwise.