[−][src]Struct kodama::Step
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
cluster1: usize
The label corresponding to the first cluster.
The algorithm for labeling clusters is documented on
Dendrogram
.
cluster2: usize
The label corresponding to the second cluster.
The algorithm for labeling clusters is documented on
Dendrogram
.
dissimilarity: T
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.
size: usize
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
.
Implementations
impl<T> Step<T>
[src]
pub fn new(
cluster1: usize,
cluster2: usize,
dissimilarity: T,
size: usize
) -> Step<T>
[src]
cluster1: usize,
cluster2: usize,
dissimilarity: T,
size: usize
) -> Step<T>
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
.
pub fn set_clusters(&mut self, cluster1: usize, cluster2: usize)
[src]
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]
pub fn eq_with_epsilon(&self, other: &Step<T>, epsilon: T) -> bool
[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]
impl<T: Debug> Debug for Step<T>
[src]
impl<T: Eq> Eq for Step<T>
[src]
impl<T: Hash> Hash for Step<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: PartialEq> PartialEq<Step<T>> for Step<T>
[src]
impl<T> StructuralEq for Step<T>
[src]
impl<T> StructuralPartialEq for Step<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Step<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Step<T> where
T: Send,
T: Send,
impl<T> Sync for Step<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Step<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Step<T> where
T: UnwindSafe,
T: 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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,