public final class SingleLinkage extends Object implements AgglomerationMethod
The general form of the Lance-Williams matrix-update formula:
d[(i,j),k] = ai*d[i,k] + aj*d[j,k] + b*d[i,j] + g*|d[i,k]-d[j,k]|
For the "single linkage" method:
ai = 0.5
aj = 0.5
b = 0
g = -0.5
Thus:
d[(i,j),k] = 0.5*d[i,k] + 0.5*d[j,k] - 0.5*|d[i,k]-d[j,k]|
= 0.5*d[i,k] + 0.5*d[j,k] - | 0.5*d[i,k] - 0.5*d[j,k] |
= d[i,j]
Constructor and Description |
---|
SingleLinkage() |
Modifier and Type | Method and Description |
---|---|
double |
computeDissimilarity(double dik,
double djk,
double dij,
int ci,
int cj,
int ck)
Compute the dissimilarity between the
newly formed cluster (i,j) and the existing cluster k.
|
String |
toString() |
public double computeDissimilarity(double dik, double djk, double dij, int ci, int cj, int ck)
AgglomerationMethod
computeDissimilarity
in interface AgglomerationMethod
dik
- dissimilarity between clusters i and kdjk
- dissimilarity between clusters j and kdij
- dissimilarity between clusters i and jci
- cardinality of cluster icj
- cardinality of cluster jck
- cardinality of cluster k