pub enum BinnerKind {
Uniform(UniformBinning),
Categorical(CategoricalBinning),
KMeans(KMeansBinning),
}Expand description
Concrete binning strategy enum, eliminating Box<dyn BinningStrategy>
heap allocations per feature per leaf.
This is used internally by HoeffdingTree
leaf states. Each variant delegates to the corresponding strategy impl.
Variants§
Uniform(UniformBinning)
Equal-width binning (default).
Categorical(CategoricalBinning)
Categorical binning – one bin per observed distinct value.
KMeans(KMeansBinning)
K-means binning (feature-gated).
Implementations§
Source§impl BinnerKind
impl BinnerKind
Sourcepub fn uniform() -> BinnerKind
pub fn uniform() -> BinnerKind
Create a new uniform binner (the default strategy).
Sourcepub fn categorical() -> BinnerKind
pub fn categorical() -> BinnerKind
Create a new categorical binner.
Sourcepub fn kmeans() -> BinnerKind
pub fn kmeans() -> BinnerKind
Create a new k-means binner.
Sourcepub fn compute_edges(&self, n_bins: usize) -> BinEdges
pub fn compute_edges(&self, n_bins: usize) -> BinEdges
Compute bin edges from observed values.
Sourcepub fn is_categorical(&self) -> bool
pub fn is_categorical(&self) -> bool
Whether this binner is for a categorical feature.
Sourcepub fn clone_fresh(&self) -> BinnerKind
pub fn clone_fresh(&self) -> BinnerKind
Create a fresh instance with the same variant but no data.
Trait Implementations§
Source§impl Clone for BinnerKind
impl Clone for BinnerKind
Source§fn clone(&self) -> BinnerKind
fn clone(&self) -> BinnerKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BinnerKind
impl RefUnwindSafe for BinnerKind
impl Send for BinnerKind
impl Sync for BinnerKind
impl Unpin for BinnerKind
impl UnsafeUnpin for BinnerKind
impl UnwindSafe for BinnerKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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