Skip to main content

CommunityComparison

Enum CommunityComparison 

Source
pub enum CommunityComparison {
    VariationOfInformation,
    NormalizedMutualInformation,
    SplitJoin,
    Rand,
    AdjustedRand,
}
Expand description

Which partition-comparison measure compare_communities returns.

Mirrors igraph_community_comparison_t.

Variants§

§

VariationOfInformation

Variation of information (Meilă 2003) — distance in [0, log n]. VI = H(C1) + H(C2) − 2·I(C1, C2). Lower means more similar; 0 iff partitions are identical.

§

NormalizedMutualInformation

Normalized mutual information (Danon et al. 2005) — similarity in [0, 1]. NMI = 2·I(C1, C2) / (H(C1) + H(C2)). Higher means more similar; 1 iff partitions are identical. Defined as 1 when both partitions have a single cluster.

§

SplitJoin

Split-join distance (van Dongen 2000) — sum of the two projection distances. Distance in [0, 2·(n − 1)]. Lower means more similar; 0 iff partitions are identical.

§

Rand

Rand index (Rand 1971) — similarity in [0, 1]. Fraction of vertex pairs the two partitions agree on (either both together or both apart). Requires n ≥ 2.

§

AdjustedRand

Adjusted Rand index (Hubert & Arabie 1985) — similarity in [-1, 1], chance-corrected. 0 means the partitions agree no more than two random partitions of the same shape would. Requires n ≥ 2. Degenerate inputs where both partitions are all-one-cluster or all-singletons return 1.0 (sklearn convention; the C reference’s formula would otherwise yield 0/0).

Trait Implementations§

Source§

impl Clone for CommunityComparison

Source§

fn clone(&self) -> CommunityComparison

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommunityComparison

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CommunityComparison

Source§

fn eq(&self, other: &CommunityComparison) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CommunityComparison

Source§

impl Eq for CommunityComparison

Source§

impl StructuralPartialEq for CommunityComparison

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.