pub trait BinsBuildingStrategy {
type Elem: Ord;
// Required methods
fn from_array<S>(array: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError>
where S: Data<Elem = Self::Elem>,
Self: Sized;
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.
This 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>) -> Result<Self, BinsBuildError>
fn from_array<S>(array: &ArrayBase<S, Ix1>) -> Result<Self, BinsBuildError>
Returns a strategy that has learnt the required parameter fo building Bins
for given
1-dimensional array, or an Err
if it is not possible to infer the required parameter
with the given data and specified strategy.
§Errors
See each of the struct-level documentation for details on errors an implementor may return.