public class WPGMALinkage extends Linkage
Note that the terms weighted and unweighted refer to the final result, not the math by which it is achieved. Thus the simple averaging in WPGMA produces a weighted result, and the proportional averaging in UPGMA produces an unweighted result.
Constructor and Description |
---|
WPGMALinkage(double[][] proximity)
Constructor.
|
WPGMALinkage(int size,
float[] proximity)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
merge(int i,
int j)
Merge two clusters into one and update the proximity matrix.
|
static WPGMALinkage |
of(double[][] data)
Given a set of data, computes the proximity and then the linkage.
|
static <T> WPGMALinkage |
of(T[] data,
smile.math.distance.Distance<T> distance)
Given a set of data, computes the proximity and then the linkage.
|
java.lang.String |
toString() |
public WPGMALinkage(double[][] proximity)
proximity
- the proximity matrix to store the distance measure of
dissimilarity. To save space, we only need the lower half of matrix.public WPGMALinkage(int size, float[] proximity)
size
- the data size.proximity
- column-wise linearized proximity matrix that stores
only the lower half. The length of proximity should be
size * (size+1) / 2.
To save space, Linkage will use this argument directly
without copy. The elements may be modified.public static WPGMALinkage of(double[][] data)
public static <T> WPGMALinkage of(T[] data, smile.math.distance.Distance<T> distance)
public java.lang.String toString()
toString
in class java.lang.Object