Package ffx.numerics.clustering
Interface ClusteringAlgorithm
- All Known Implementing Classes:
DefaultClusteringAlgorithm
,PDistClusteringAlgorithm
public interface ClusteringAlgorithm
Defines algorithms that produce hierarchical clusters from distance data.
- Since:
- 1.0
- Author:
- Lars Behnke, 2013, Michael J. Schnieders
-
Method Summary
Modifier and TypeMethodDescriptionperformClustering
(double[][] distances, String[] clusterNames, LinkageStrategy linkageStrategy) Performs hierarchical agglomerative clustering on a square distance matrix.performFlatClustering
(double[][] distances, String[] clusterNames, LinkageStrategy linkageStrategy, Double threshold) Performs a flat clustering by agglomerating until the next linkage distance would exceed the provided threshold, and returns the list of clusters at that cut.performWeightedClustering
(double[][] distances, String[] clusterNames, double[] weights, LinkageStrategy linkageStrategy) Performs hierarchical clustering when each initial element has an associated weight.
-
Method Details
-
performClustering
Cluster performClustering(double[][] distances, String[] clusterNames, LinkageStrategy linkageStrategy) Performs hierarchical agglomerative clustering on a square distance matrix.- Parameters:
distances
- an N x N symmetric matrix of pairwise distances (upper triangle used)clusterNames
- an array of N names corresponding to rows/columns of distanceslinkageStrategy
- the linkage criterion used to update inter-cluster distances- Returns:
- the root Cluster of the resulting hierarchy (dendrogram)
-
performWeightedClustering
Cluster performWeightedClustering(double[][] distances, String[] clusterNames, double[] weights, LinkageStrategy linkageStrategy) Performs hierarchical clustering when each initial element has an associated weight.- Parameters:
distances
- an N x N symmetric matrix of pairwise distancesclusterNames
- an array of N names corresponding to the input elementsweights
- an array of N non-negative weights for the input elementslinkageStrategy
- the linkage criterion used to update inter-cluster distances- Returns:
- the root Cluster of the resulting hierarchy (dendrogram)
-
performFlatClustering
List<Cluster> performFlatClustering(double[][] distances, String[] clusterNames, LinkageStrategy linkageStrategy, Double threshold) Performs a flat clustering by agglomerating until the next linkage distance would exceed the provided threshold, and returns the list of clusters at that cut.- Parameters:
distances
- an N x N symmetric matrix of pairwise distancesclusterNames
- an array of N names corresponding to the input elementslinkageStrategy
- the linkage criterion used to update inter-cluster distancesthreshold
- the maximum allowed inter-cluster linkage distance for merging- Returns:
- list of clusters obtained at the specified threshold
-