Fast algorithms for single, average/UPGMA and complete linkage clustering.

LTS Haskell 20.26:0.4.7
Stackage Nightly 2022-11-17:0.4.7
Latest on Hackage:0.4.7

See all snapshots hierarchical-clustering appears in

BSD-3-Clause licensed by Felipe Almeida Lessa
Maintained by [email protected]
This version can be pinned in stack with:hierarchical-clustering-0.4.7@sha256:85beadd12f6c1dc2836478068291277c5e89a6e706d4fc8a652b7be8a918b5c4,3335
Depends on 3 packages(full list with versions):

This package provides a function to create a dendrogram from a list of items and a distance function between them. Initially a singleton cluster is created for each item, and then new, bigger clusters are created by merging the two clusters with least distance between them. The distance between two clusters is calculated according to the linkage type. The dendrogram represents not only the clusters but also the order on which they were created.

This package has many implementations with different performance characteristics. There are SLINK and CLINK algorithm implementations that are optimal in both space and time. There are also naive implementations using a distance matrix. Using the dendrogram function from Data.Clustering.Hierarchical automatically chooses the best implementation we have.

Changes in version 0.4:

  • Specialize the distance type to Double for efficiency reasons. It's uncommon to use distances other than Double.

  • Implement SLINK and CLINK. These are optimal algorithms in both space and time for single and complete linkage, respectively, running in O(n^2) time and O(n) space.

  • Reorganized internal implementation.

  • Some performance improvements for the naive implementation.

  • Better test coverage. Also, performance improvements for the test suite, now running in 3 seconds (instead of one minute).

Changes in version (version was skipped):

  • Added tests for many things. Use cabal test =).

Changes in version 0.3.1:

  • Works with containers 0.4 (thanks, Doug Beardsley).

  • Removed some internal unnecessary overheads and added some strictness.

Changes in version

  • Listed changes of unreleased version 0.2.

Changes in version 0.3:

  • Added function cutAt.

  • Fixed complexity in Haddock comments.

Changes in version 0.2:

  • Added function elements.

  • Added separate functions for each linkage type. This may be useful if you want to create a dendrogram and your distance data type isn't an instance of Floating.