Package ffx.numerics.clustering
Class DefaultClusteringAlgorithm
java.lang.Object
ffx.numerics.clustering.DefaultClusteringAlgorithm
- All Implemented Interfaces:
ClusteringAlgorithm
Clustering algorithm that operates on a full N x N distance matrix to produce
hierarchical agglomerative clusters (dendrogram), with optional support for
per-element weights and flat clustering by threshold.
- Since:
- 1.0
- Author:
- Lars Behnke, 2013, Michael J. Schnieders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionperformClustering(double[][] distances, String[] clusterNames, LinkageStrategy linkageStrategy) Performs hierarchical agglomerative clustering using a full N x N distance matrix.performFlatClustering(double[][] distances, String[] clusterNames, LinkageStrategy linkageStrategy, Double threshold) Produces a flat clustering by agglomerating until the next merge would exceed the threshold.performWeightedClustering(double[][] distances, String[] clusterNames, double[] weights, LinkageStrategy linkageStrategy) Performs hierarchical clustering when each element has an associated weight.
-
Constructor Details
-
DefaultClusteringAlgorithm
public DefaultClusteringAlgorithm()
-
-
Method Details
-
performClustering
public Cluster performClustering(double[][] distances, String[] clusterNames, LinkageStrategy linkageStrategy) Performs hierarchical agglomerative clustering using a full N x N distance matrix.- Specified by:
performClusteringin interfaceClusteringAlgorithm- Parameters:
distances- an N x N symmetric matrix of pairwise distancesclusterNames- names corresponding to rows/columns of the distance matrixlinkageStrategy- linkage criterion used to compute inter-cluster distances- Returns:
- root Cluster of the resulting hierarchy
-
performFlatClustering
public List<Cluster> performFlatClustering(double[][] distances, String[] clusterNames, LinkageStrategy linkageStrategy, Double threshold) Produces a flat clustering by agglomerating until the next merge would exceed the threshold.- Specified by:
performFlatClusteringin interfaceClusteringAlgorithm- Parameters:
distances- an N x N symmetric matrix of pairwise distancesclusterNames- names corresponding to the distance matrixlinkageStrategy- linkage criterion used during agglomerationthreshold- maximum allowed linkage distance for merging- Returns:
- list of clusters at the chosen cut
-
performWeightedClustering
public Cluster performWeightedClustering(double[][] distances, String[] clusterNames, double[] weights, LinkageStrategy linkageStrategy) Performs hierarchical clustering when each element has an associated weight.- Specified by:
performWeightedClusteringin interfaceClusteringAlgorithm- Parameters:
distances- an N x N symmetric matrix of distancesclusterNames- names for the N input elementsweights- weights for the N input elementslinkageStrategy- linkage criterion to use- Returns:
- root Cluster of the resulting hierarchy
-