Package com.chemaxon.clustering.wards
Class LanceWilliamsAlgorithm
- java.lang.Object
-
- com.chemaxon.clustering.wards.LanceWilliamsAlgorithm
-
@Beta @PublicAPI public final class LanceWilliamsAlgorithm extends Object
Agglomerative hierarchical clustering implementation for Lance-Williams algorithm family.Licensing: this class is part of the JKlustor suite; it can be used with valid
JKlustor
license.Please note that this class is marked with @Beta annotation, so it can be subject of incompatible changes or removal in later releases.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double[][]
calculateDissimilarityMatrix(DissimilarityInput input, SubProgressObserver po)
Distance matrix calculation.static IDBasedHierarchicClustering
cluster(double[][] dissim, LanceWilliamsMerge merge, SubProgressObserver po)
Invoke clustering.static IDBasedHierarchicClustering
cluster(DissimilarityInput input, LanceWilliamsMerge merge, ProgressObserver po)
Invoke clustering.
-
-
-
Method Detail
-
calculateDissimilarityMatrix
public static double[][] calculateDissimilarityMatrix(DissimilarityInput input, SubProgressObserver po)
Distance matrix calculation.- Parameters:
input
- Input dissimilarity spacepo
- Progress observer- Returns:
- Distance matrix, with
[<TARGET>][<QUERY>]
indices
-
cluster
public static IDBasedHierarchicClustering cluster(DissimilarityInput input, LanceWilliamsMerge merge, ProgressObserver po) throws CancellationException
Invoke clustering.The current implementation requires O(n2) storage and O(n2) pairwise input comparison invocation. Over the stored dissimilarity values it requires O(n3) simple numerical comparison steps.
- Parameters:
input
- Input dissimilarity spacemerge
- Cluster distance update functionpo
- Observing progress observer. TwoProgressObserver.subTask(java.lang.String, long)
} will be associate to the distance matrix calculation and to the clustering iterations- Returns:
- Clustered hierarchy, preferred levels set as cluster distances
- Throws:
CancellationException
- Upon cancellation through the given ProgressObserverIllegalArgumentException
- When less than 2 input specifiedIllegalStateException
- When distance inconsistency found during merging: the distance of a merged cluster and any other cluster must be not less than the distance of the merging clusterschemaxon.license.LicenseException
- when appropriate license is not available
-
cluster
public static IDBasedHierarchicClustering cluster(double[][] dissim, LanceWilliamsMerge merge, SubProgressObserver po) throws CancellationException
Invoke clustering.The current implementation requires O(n2) storage and O(n2) pairwise input comparison invocation. Over the stored dissimilarity values it requires O(n3) simple numerical comparison steps.
- Parameters:
dissim
- Distance matrix, with[<TARGET>][<QUERY>]
indicesmerge
- Cluster distance update functionpo
- Observing to track progress. Will be closed upon finishing.- Returns:
- Clustered hierarchy, preferred levels set as cluster distances
- Throws:
CancellationException
- Upon cancellation through the given ProgressObserverIllegalArgumentException
- When less than 2 input specifiedIllegalStateException
- When distance inconsistency found during merging: the distance of a merged cluster and any other cluster must be not less than the distance of the merging clusterschemaxon.license.LicenseException
- when appropriate license is not available
-
-