[−][src]Enum algorithms_edu::algo::ml::clustering::hierarchical::Method
A method for computing the dissimilarities between clusters.
The method selected dictates how the dissimilarities are computed whenever
a new cluster is formed. In particular, when clusters a
and b
are
merged into a new cluster ab
, then the pairwise dissimilarity between
ab
and every other cluster is computed using one of the methods variants
in this type.
Variants
Assigns the minimum dissimilarity between all pairs of observations.
Specifically, if AB
is a newly merged cluster and X
is every other
cluster, then the pairwise dissimilarity between AB
and X
is
computed by
min(d[ab, x] for ab in AB for x in X)
where ab
and x
correspond to all observations in AB
and X
,
respectively.
Assigns the maximum dissimilarity between all pairs of observations.
Specifically, if AB
is a newly merged cluster and X
is every other
cluster, then the pairwise dissimilarity between AB
and X
is
computed by
max(d[ab, x] for ab in AB for x in X)
where ab
and x
correspond to all observations in AB
and X
,
respectively.
Assigns the average dissimilarity between all pairs of observations.
Specifically, if AB
is a newly merged cluster and X
is every other
cluster, then the pairwise dissimilarity between AB
and X
is
computed by
sum(d[ab, x] for ab in AB for x in X) / (|AB| * |X|)
where ab
and x
correspond to all observations in AB
and X
,
respectively, and |AB|
and |X|
correspond to the total number of
observations in AB
and X
, respectively.
Assigns the weighted dissimilarity between clusters.
Specifically, if AB
is a newly merged cluster and X
is every other
cluster, then the pairwise dissimilarity between AB
and X
is
computed by
0.5 * (d(A, X) + d(B, X))
where A
and B
correspond to the clusters that merged to create
AB
.
Assigns the Ward dissimilarity between clusters.
Specifically, if AB
is a newly merged cluster and X
is every other
cluster, then the pairwise dissimilarity between AB
and X
is
computed by
let t1 = d(A, X)^2 * (|A| + |X|);
let t2 = d(B, X)^2 * (|B| + |X|);
let t3 = d(A, B)^2 * |X|;
let T = |A| + |B| + |X|;
sqrt(t1/T + t2/T + t3/T)
where A
and B
correspond to the clusters that merged to create
AB
.
Assigns the centroid dissimilarity between clusters.
Specifically, if AB
is a newly merged cluster and X
is every other
cluster, then the pairwise dissimilarity between AB
and X
is
computed by
let t1 = |A| * d(A, X) + |B| * d(B, X));
let t2 = |A| * |B| * d(A, B);
let size = |A| + |B|;
sqrt(t1/size + t2/size^2)
where A
and B
correspond to the clusters that merged to create
AB
.
Assigns the median dissimilarity between clusters.
Specifically, if AB
is a newly merged cluster and X
is every other
cluster, then the pairwise dissimilarity between AB
and X
is
computed by
sqrt(d(A, X)/2 + d(B, X)/2 - d(A, B)/4)
where A
and B
correspond to the clusters that merged to create
AB
.
Trait Implementations
impl Clone for Method
[src]
impl Copy for Method
[src]
impl Debug for Method
[src]
impl Eq for Method
[src]
impl PartialEq<Method> for Method
[src]
pub fn eq(&self, other: &Method) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Method
[src]
impl StructuralPartialEq for Method
[src]
Auto Trait Implementations
impl RefUnwindSafe for Method
[src]
impl Send for Method
[src]
impl Sync for Method
[src]
impl Unpin for Method
[src]
impl UnwindSafe for Method
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,