lambda-ml.clustering.hierarchical

Hierarchical agglomerative clustering.

Example usage:

(def data [[1 1 1 0 1 0 0 1 1 1]
           [1 1 0 1 1 0 0 0 0 1]
           [0 1 1 0 1 0 0 1 0 0]
           [0 0 0 1 0 1 0 0 0 0]
           [1 1 1 0 1 0 1 1 1 0]
           [0 1 0 1 1 0 0 0 0 1]
           [0 1 1 0 1 1 0 1 1 0]])
(agglomerative-clustering single-link lambda-ml.distance/euclidean data)
;;=> [[1 5] [0 4] [2 6] [0 2] [0 1] [0 3]]

agglomerative-clustering

(agglomerative-clustering link f points)

Returns a clustering of points represented as a seq of merges, where each merge is a pair of indexes indicating the two points to be merged at each step, using the linkage function link and distance function f.

distance-queues

(distance-queues distances)

Returns a map of each point to a priority queue of all other points sorted by increasing distance.

pairwise-distances

(pairwise-distances f points)

Returns a map representing the distance matrix between all points.