pub struct FeatureSplit {
pub feature_idx: usize,
pub threshold: f64,
pub impurity_reduction: f64,
pub n_left: usize,
pub n_right: usize,
pub information_gain: Option<f64>,
}Expand description
Parallel feature evaluation for tree construction
Fields§
§feature_idx: usizeFeature index
threshold: f64Best threshold for this feature
impurity_reduction: f64Impurity reduction achieved by this split
n_left: usizeNumber of samples that would go left
n_right: usizeNumber of samples that would go right
information_gain: Option<f64>Information gain (for classification)
Implementations§
Source§impl FeatureSplit
impl FeatureSplit
Sourcepub fn new(
feature_idx: usize,
threshold: f64,
impurity_reduction: f64,
n_left: usize,
n_right: usize,
) -> Self
pub fn new( feature_idx: usize, threshold: f64, impurity_reduction: f64, n_left: usize, n_right: usize, ) -> Self
Create a new feature split
Sourcepub fn with_information_gain(self, gain: f64) -> Self
pub fn with_information_gain(self, gain: f64) -> Self
Set information gain for classification
Sourcepub fn quality_score(&self) -> f64
pub fn quality_score(&self) -> f64
Get the split quality score
Trait Implementations§
Source§impl Clone for FeatureSplit
impl Clone for FeatureSplit
Source§fn clone(&self) -> FeatureSplit
fn clone(&self) -> FeatureSplit
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 FeatureSplit
impl RefUnwindSafe for FeatureSplit
impl Send for FeatureSplit
impl Sync for FeatureSplit
impl Unpin for FeatureSplit
impl UnwindSafe for FeatureSplit
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> 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