pub struct AssociationRule { /* private fields */ }Expand description
An association rule antecedent ⇒ consequent with its standard metrics.
Both sides are disjoint, non-empty sets of item indices in ascending order. The
metrics follow the standard market-basket definitions (and mlxtend’s):
support is the joint support of antecedent ∪ consequent; confidence is
support(A ∪ C) / support(A); lift is confidence / support(C); leverage
is support(A ∪ C) − support(A)·support(C); conviction is
(1 − support(C)) / (1 − confidence) (+∞ for a perfectly-confident rule).
Implementations§
Source§impl AssociationRule
impl AssociationRule
Sourcepub fn antecedent(&self) -> &[usize]
pub fn antecedent(&self) -> &[usize]
The antecedent item indices, in ascending order.
Sourcepub fn consequent(&self) -> &[usize]
pub fn consequent(&self) -> &[usize]
The consequent item indices, in ascending order.
Sourcepub const fn confidence(&self) -> f64
pub const fn confidence(&self) -> f64
The confidence support(A ∪ C) / support(A), in [0, 1].
Sourcepub const fn conviction(&self) -> f64
pub const fn conviction(&self) -> f64
The conviction (1 − support(C)) / (1 − confidence) (+∞ if confidence == 1).
Trait Implementations§
Source§impl Clone for AssociationRule
impl Clone for AssociationRule
Source§fn clone(&self) -> AssociationRule
fn clone(&self) -> AssociationRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AssociationRule
impl Debug for AssociationRule
Source§impl PartialEq for AssociationRule
impl PartialEq for AssociationRule
Source§fn eq(&self, other: &AssociationRule) -> bool
fn eq(&self, other: &AssociationRule) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AssociationRule
Auto Trait Implementations§
impl Freeze for AssociationRule
impl RefUnwindSafe for AssociationRule
impl Send for AssociationRule
impl Sync for AssociationRule
impl Unpin for AssociationRule
impl UnsafeUnpin for AssociationRule
impl UnwindSafe for AssociationRule
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