dist-lib
| (require dist-lib) | package: dist-lib |
dist-lib is a library for distance-related algorithms.
1 Distances
2 Hierarchical clustering
A hierarchical clustering consumes a distance matrix and produces a dendogram tree. Such trees can then be visualized as a bitmap.
2.1 Dendogram Trees
The end result of a hierarchical clustering is a dendogram tree.
value
tree/c : contract?
procedure
(tree-elem-list tree) → (listof string?)
tree : tree/c
procedure
(tree-elem-count tree) → natural?
tree : tree/c
procedure
(tree-depth tree) → distance?
tree : tree/c
procedure
(tree-level-left tree) → natural?
tree : tree/c
procedure
(tree-level-right tree) → natural?
tree : tree/c
procedure
(tree-equal? tree) → boolean?
tree : tree/c
|
superclass: abstract-tree-image-factory% |
constructor
(new tree-image-factory/table% [tree tree] [ [draw-labels draw-labels] [depth depth]]) → (is-a?/c tree-image-factory/table%) tree : tree/c draw-labels : boolean? = #t depth : natural? = 10 Construct an instance of image-factory<%> from a dendogram tree to be plotted in table form. If draw-labels is #t then labels are drawn on the leaves of the tree. The drawing algorithm normalizes the tree’s depth to the value of depth.Return the image constructed from the dendogram tree.
|
superclass: abstract-tree-image-factory% |
constructor
(new tree-image-factory/tree% [tree tree] [ [draw-labels draw-labels] [depth depth]]) → (is-a?/c tree-image-factory/tree%) tree : tree/c draw-labels : boolean? = #t depth : natural? = 10 Construct an instance of image-factory<%> from a dendogram tree to be plotted in tree form. If draw-labels is #t then labels are drawn on the leaves of the tree. The drawing algorithm normalizes the tree’s depth to the value of depth.Return the image constructed from the dendogram tree.
2.2 Distance Matrices
The starting point of a hierarchical clustering is a distance matrix represented in form of a dist-matrix<%> instance.
|
Returns the distance of a given entry a from the leaf layer of the clustering.
method
(send a-dist-matrix get-elem-count) → natural?
Returns the number of entries at the current layer of the clustering.
method
(send a-dist-matrix get-elem-dist a b) → distance?
a : string? b : string? Returns the distance between the entries labeled a and b at the current layer of the clustering.
method
(send a-dist-matrix get-elem-set) → (set/c string?)
Returns the labels of all entries at the current layer of the clustering.