Struct linfa_trees::TreeNode [−][src]
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]
fn hash<H: Hasher>(&self, state: &mut H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
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,
F: RefUnwindSafe,
L: RefUnwindSafe,
impl<F, L> Send for TreeNode<F, L> where
F: Send,
L: Send,
F: Send,
L: Send,
impl<F, L> Sync for TreeNode<F, L> where
F: Sync,
L: Sync,
F: Sync,
L: Sync,
impl<F, L> Unpin for TreeNode<F, L> where
F: Unpin,
L: Unpin,
F: Unpin,
L: Unpin,
impl<F, L> UnwindSafe for TreeNode<F, L> where
F: UnwindSafe,
L: UnwindSafe,
F: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,