Struct linfa_trees::TreeNode[][src]

pub struct TreeNode<F, L> { /* fields omitted */ }

A node in the decision tree

Implementations

impl<F: Float, L: Label + Debug> TreeNode<F, L>[src]

pub fn is_leaf(&self) -> bool[src]

Returns true if the node has no children

pub fn depth(&self) -> usize[src]

Returns the depth of the node in the decision tree

pub fn prediction(&self) -> Option<L>[src]

Returns Some(prediction) for leaf nodes and None for internal nodes.

pub fn children(&self) -> Vec<&Option<Box<TreeNode<F, L>>>>[src]

Returns both children, first left then right

pub fn split(&self) -> (usize, F, F)[src]

Return the split (feature index, value) and its impurity decrease

pub fn feature_name(&self) -> Option<&String>[src]

Returns the name of the feature used in the split if the node is internal, None otherwise

Trait Implementations

impl<F: Clone, L: Clone> Clone for TreeNode<F, L>[src]

impl<F: Debug, L: Debug> Debug for TreeNode<F, L>[src]

impl<F, L> Eq for TreeNode<F, L>[src]

impl<F: Float, L: Label> Hash for TreeNode<F, L>[src]

impl<F, L> PartialEq<TreeNode<F, L>> for TreeNode<F, L>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,