Class SingleLinkageClusterer

  • public class SingleLinkageClusterer
    extends Object
    An implementation of a single linkage clusterer See
    Jose Duarte
    • Constructor Detail

      • SingleLinkageClusterer

        public SingleLinkageClusterer​(double[][] matrix,
                                      boolean isScoreMatrix)
        Constructs a new SingleLinkageClusterer Subsequently use getDendrogram() to get the full tree or getClusters(double) to get the clusters at a certain cutoff in the tree Please note that the matrix will be altered during the clustering procedure. A copy must be made before by the user if needing to use the original matrix further.
        matrix - the distance matrix with distance values in j>i half, all other values will be ignored
        isScoreMatrix - if false the matrix will be considered a distance matrix: lower values (distances) mean closer objects, if true the matrix will be considered a score matrix: larger values (scores) mean closer objects
        IllegalArgumentException - if matrix not square
    • Method Detail

      • getDendrogram

        public org.biojava.nbio.core.util.SingleLinkageClusterer.LinkedPair[] getDendrogram()
        Get the full dendrogram (size n-1) result of the hierarchical clustering
      • getClusters

        public Map<Integer,​Set<Integer>> getClusters​(double cutoff)
        Get the clusters by cutting the dendrogram at given cutoff
        cutoff -
        Map from cluster numbers to indices of the cluster members