pub trait BinsBuildingStrategy {
type Elem: Ord;
fn from_array<S>(array: &ArrayBase<S, Ix1>) -> Self
where
S: Data<Elem = Self::Elem>;
fn build(&self) -> Bins<Self::Elem>;
fn n_bins(&self) -> usize;
}
Expand description
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.
Required Associated Types
Required Methods
sourcefn from_array<S>(array: &ArrayBase<S, Ix1>) -> Selfwhere
S: Data<Elem = Self::Elem>,
fn from_array<S>(array: &ArrayBase<S, Ix1>) -> Selfwhere
S: Data<Elem = Self::Elem>,
Given some observations in a 1-dimensional array it returns a BinsBuildingStrategy
that has learned the required parameter to build a collection of Bins
.
sourcefn build(&self) -> Bins<Self::Elem>
fn build(&self) -> Bins<Self::Elem>
Returns a Bins
instance, built accordingly to the parameters
inferred from observations in from_array
.
sourcefn n_bins(&self) -> usize
fn n_bins(&self) -> usize
Returns the optimal number of bins, according to the parameters
inferred from observations in from_array
.