@Beta @PublicAPI public final class LanceWilliamsAlgorithm extends Object
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.
Modifier and Type | Method and Description |
---|---|
static double[][] |
calculateDissimilarityMatrix(DissimilarityInput input,
SubProgressObserver po)
Distance matrix calculation.
|
static IDBasedHierarchicClustering |
cluster(DissimilarityInput input,
LanceWilliamsMerge merge,
ProgressObserver po)
Invoke clustering.
|
static IDBasedHierarchicClustering |
cluster(double[][] dissim,
LanceWilliamsMerge merge,
SubProgressObserver po)
Invoke clustering.
|
public static double[][] calculateDissimilarityMatrix(DissimilarityInput input, SubProgressObserver po)
input
- Input dissimilarity spacepo
- Progress observer[<TARGET>][<QUERY>]
indicespublic static IDBasedHierarchicClustering cluster(DissimilarityInput input, LanceWilliamsMerge merge, ProgressObserver po) throws CancellationException
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.
input
- Input dissimilarity spacemerge
- Cluster distance update functionpo
- Observing progress observer. Two ProgressObserver.subTask(java.lang.String, long)
} will be
associate to the distance matrix calculation and to the clustering iterationsCancellationException
- 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
clustersLicenseException
- when appropriate license is not availablepublic static IDBasedHierarchicClustering cluster(double[][] dissim, LanceWilliamsMerge merge, SubProgressObserver po) throws CancellationException
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.
dissim
- Distance matrix, with [<TARGET>][<QUERY>]
indicesmerge
- Cluster distance update functionpo
- Observing to track progress. Will be closed upon finishing.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
clustersLicenseException
- when appropriate license is not available