pub enum HistNode<F> {
Split {
feature: usize,
threshold_bin: u16,
nan_goes_left: bool,
left: usize,
right: usize,
gain: F,
n_samples: usize,
},
Leaf {
value: F,
n_samples: usize,
},
}Expand description
A node in a histogram-based gradient boosting tree.
Unlike crate::decision_tree::Node, thresholds are stored as bin indices
rather than raw feature values. Prediction at a split checks whether the
sample’s bin index for the feature is <= threshold_bin.
Variants§
Split
An internal split node.
Fields
§
gain: FWeighted gain from this split (for feature importance).
Leaf
A leaf node that stores a prediction value.
Trait Implementations§
Source§impl<'de, F> Deserialize<'de> for HistNode<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for HistNode<F>where
F: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<F> Freeze for HistNode<F>where
F: Freeze,
impl<F> RefUnwindSafe for HistNode<F>where
F: RefUnwindSafe,
impl<F> Send for HistNode<F>where
F: Send,
impl<F> Sync for HistNode<F>where
F: Sync,
impl<F> Unpin for HistNode<F>where
F: Unpin,
impl<F> UnsafeUnpin for HistNode<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for HistNode<F>where
F: UnwindSafe,
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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