- data Dendrogram d a
- = Leaf a
- | Branch d (Dendrogram d a) (Dendrogram d a)
- data Linkage
- completeDendrogram :: (Fractional d, Ord d) => Linkage -> [a] -> (a -> a -> d) -> Dendrogram d a
Documentation
data Dendrogram d a Source
Data structure for storing hierarchical clusters.
Leaf a | The leaf contains the item |
Branch d (Dendrogram d a) (Dendrogram d a) | Each branch connects two clusters/dendrograms that are
|
Functor (Dendrogram d) | Does not recalculate the distances! |
Foldable (Dendrogram d) | |
Traversable (Dendrogram d) | |
(Eq d, Eq a) => Eq (Dendrogram d a) | |
(Ord d, Ord a) => Ord (Dendrogram d a) | |
(Show d, Show a) => Show (Dendrogram d a) |
The linkage type determines how the distance between clusters will be calculated.
SingleLinkage | The distance between two clusters |
CompleteLinkage | The distance between two clusters |
UPGMA | Unweighted Pair Group Method with Arithmetic mean, also
called "average linkage". The distance between two
clusters |
FakeAverageLinkage | This method is usually wrongly called "average linkage".
The distance between cluster
|
completeDendrogram :: (Fractional d, Ord d) => Linkage -> [a] -> (a -> a -> d) -> Dendrogram d aSource
O(n^2) Calculates a complete, rooted dendrogram for a list of items and a distance function.