Struct linfa_trees::TreeNode
source · [−]pub struct TreeNode<F, L> { /* private fields */ }
Expand description
A node in the decision tree
Implementations
sourceimpl<F: Float, L: Label + Debug> TreeNode<F, L>
impl<F: Float, L: Label + Debug> TreeNode<F, L>
sourcepub fn prediction(&self) -> Option<L>
pub fn prediction(&self) -> Option<L>
Returns Some(prediction)
for leaf nodes and None
for internal nodes.
sourcepub fn children(&self) -> Vec<&Option<Box<TreeNode<F, L>>>>
pub fn children(&self) -> Vec<&Option<Box<TreeNode<F, L>>>>
Returns both children, first left then right
sourcepub fn split(&self) -> (usize, F, F)
pub fn split(&self) -> (usize, F, F)
Return the split (feature index, value) and its impurity decrease
sourcepub fn feature_name(&self) -> Option<&String>
pub fn feature_name(&self) -> Option<&String>
Returns the name of the feature used in the split if the node is internal,
None
otherwise
Trait Implementations
impl<F, L> Eq for TreeNode<F, L>
Auto Trait Implementations
impl<F, L> RefUnwindSafe for TreeNode<F, L> where
F: RefUnwindSafe,
L: RefUnwindSafe,
impl<F, L> Send for TreeNode<F, L> where
F: Send,
L: Send,
impl<F, L> Sync for TreeNode<F, L> where
F: Sync,
L: Sync,
impl<F, L> Unpin for TreeNode<F, L> where
F: Unpin,
L: Unpin,
impl<F, L> UnwindSafe for TreeNode<F, L> where
F: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more