Enum linfa_trees::SplitQuality
source · pub enum SplitQuality {
Gini,
Entropy,
}
Expand description
The metric used to determine the feature by which a node is split
Variants§
Gini
Measures the degree of probability of a randomly chosen point in the subtree being misclassified, defined as one minus the sum over all labels of the squared probability of encountering that label. The Gini index of the root is given by the weighted sum of the indexes of its two subtrees. At each step the split is applied to the feature which decreases the most the Gini impurity of the root.
Entropy
Measures the entropy of a subtree, defined as the sum over all labels of the probability of encountering that label in the subtree times its logarithm in base two, with negative sign. The entropy of the root minus the weighted sum of the entropy of its two subtrees defines the “information gain” obtained by applying the split. At each step the split is applied to the feature with the biggest information gain
Trait Implementations§
source§impl Clone for SplitQuality
impl Clone for SplitQuality
source§fn clone(&self) -> SplitQuality
fn clone(&self) -> SplitQuality
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SplitQuality
impl Debug for SplitQuality
source§impl Hash for SplitQuality
impl Hash for SplitQuality
source§impl PartialEq for SplitQuality
impl PartialEq for SplitQuality
source§fn eq(&self, other: &SplitQuality) -> bool
fn eq(&self, other: &SplitQuality) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for SplitQuality
impl Eq for SplitQuality
impl StructuralEq for SplitQuality
impl StructuralPartialEq for SplitQuality
Auto Trait Implementations§
impl RefUnwindSafe for SplitQuality
impl Send for SplitQuality
impl Sync for SplitQuality
impl Unpin for SplitQuality
impl UnwindSafe for SplitQuality
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.