T
- the type of input object.public class CLARANS<T> extends CentroidClustering<T,T>
CLARANS has two parameters: the maximum number of neighbors examined (maxNeighbor) and the number of local minima obtained (numLocal). The higher the value of maxNeighbor, the closer is CLARANS to PAM, and the longer is each search of a local minima. But the quality of such a local minima is higher and fewer local minima needs to be obtained.
centroids, distance, distortion
k, OUTLIER, size, y
Constructor and Description |
---|
CLARANS(double distortion,
T[] medoids,
int[] y,
java.util.function.ToDoubleBiFunction<T,T> distance)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static <T> CLARANS<T> |
fit(T[] data,
int k,
int maxNeighbor,
java.util.function.ToDoubleBiFunction<T,T> distance)
Constructor.
|
static <T> CLARANS<T> |
fit(T[] data,
int k,
java.util.function.ToDoubleBiFunction<T,T> distance)
Clustering data into k clusters.
|
compareTo, predict, toString
run, seed
public static <T> CLARANS<T> fit(T[] data, int k, java.util.function.ToDoubleBiFunction<T,T> distance)
data
- the observations.k
- the number of clusters.distance
- the lambda of distance measure.public static <T> CLARANS<T> fit(T[] data, int k, int maxNeighbor, java.util.function.ToDoubleBiFunction<T,T> distance)
data
- the observations.k
- the number of clusters.maxNeighbor
- the maximum number of neighbors examined during
the random search of local minima.distance
- the lambda of distance measure.