pub trait BinsBuildingStrategy {
type Elem: Ord;
// Required methods
fn from_array(
array: &ArrayRef<Self::Elem, Ix1>,
) -> Result<Self, BinsBuildError>
where 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(array: &ArrayRef<Self::Elem, Ix1>) -> Result<Self, BinsBuildError>where
Self: Sized,
fn from_array(array: &ArrayRef<Self::Elem, Ix1>) -> Result<Self, BinsBuildError>where
Self: Sized,
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.