pub struct TreeNode {
pub id: usize,
pub depth: usize,
pub sample_indices: Vec<usize>,
pub impurity: f64,
pub prediction: f64,
pub potential_decrease: f64,
pub best_split: Option<CustomSplit>,
pub parent_id: Option<usize>,
pub is_leaf: bool,
}Expand description
Tree node for building algorithms
Fields§
§id: usizeNode ID
depth: usizeDepth of this node
sample_indices: Vec<usize>Samples in this node
impurity: f64Impurity of this node
prediction: f64Predicted value/class for this node
potential_decrease: f64Potential impurity decrease if this node is split
best_split: Option<CustomSplit>Best split for this node (if any)
parent_id: Option<usize>Parent node ID
is_leaf: boolWhether this is a leaf node
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeNode
impl RefUnwindSafe for TreeNode
impl Send for TreeNode
impl Sync for TreeNode
impl Unpin for TreeNode
impl UnwindSafe for TreeNode
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