pub enum BinnerKind {
Uniform(UniformBinning),
Categorical(CategoricalBinning),
}Available on crate feature
alloc only.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.
Implementations§
Source§impl BinnerKind
impl BinnerKind
Sourcepub fn categorical() -> Self
pub fn categorical() -> Self
Create a new categorical 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) -> Self
pub fn clone_fresh(&self) -> Self
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