Struct kodama::Step[][src]

pub struct Step<T> {
    pub cluster1: usize,
    pub cluster2: usize,
    pub dissimilarity: T,
    pub size: usize,
}

A single merge step in a dendrogram.

A step always corresponds to a merge between two clusters, where each cluster has at least one observation. Each step itself corresponds to a new cluster containing the observations of the merged clusters.

By convention, the smaller label is assigned to cluster1.

The type parameter T refers to the type of dissimilarity used. In practice, T is a floating point type.

Fields

The label corresponding to the first cluster.

The algorithm for labeling clusters is documented on Dendrogram.

The label corresponding to the second cluster.

The algorithm for labeling clusters is documented on Dendrogram.

The dissimilarity between cluster1 and cluster2.

If both cluster1 and cluster2 correspond to singleton clusters, then this dissimilarity is equivalent to the pairwise dissimilarity between the clusters' corresponding observations. Otherwise, the dissimilarity is computed according to the clustering Method used.

The total number of observations in this merged cluster. This is always equivalent to the total number of observations in cluster1 plus the total number of observations in cluster2.

Methods

impl<T> Step<T>
[src]

Create a new a step that can be added to a dendrogram.

Note that the clustering labels given are normalized such that the smallest label is always assigned to cluster1.

Set the cluster labels on this step.

Note that the clustering labels given are normalized such that the smallest label is always assigned to cluster1.

impl<T: Float> Step<T>
[src]

Compare two steps for approximate equality.

Approximate equality in this case refers to the dissimilarity in each step. In particular, two dissimilarity are considered equal if and only if the absolute value of their difference is less than or equal to the given epsilon value.

Trait Implementations

impl<T: Clone> Clone for Step<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Step<T>
[src]

Formats the value using the given formatter. Read more

impl<T: Eq> Eq for Step<T>
[src]

impl<T: Hash> Hash for Step<T>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: PartialEq> PartialEq for Step<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl<T> Send for Step<T> where
    T: Send

impl<T> Sync for Step<T> where
    T: Sync