T - the type of input object.public class CLARANS<T> extends PartitionClustering<T> implements java.io.Serializable
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.
k, size, yOUTLIER| Constructor and Description |
|---|
CLARANS(T[] data,
smile.math.distance.Distance<T> distance,
int k)
Constructor.
|
CLARANS(T[] data,
smile.math.distance.Distance<T> distance,
int k,
int maxNeighbor)
Constructor.
|
CLARANS(T[] data,
smile.math.distance.Distance<T> distance,
int k,
int maxNeighbor,
int numLocal)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distortion()
Returns the distortion.
|
int |
getMaxNeighbor()
Returns the maximum number of neighbors examined during a search of local minima.
|
int |
getNumLocalMinima()
Returns the number of local minima to search for.
|
T[] |
medoids()
Returns the medoids.
|
int |
predict(T x)
Cluster a new instance.
|
java.lang.String |
toString() |
getClusterLabel, getClusterSize, getNumClusters, seed, seedpublic CLARANS(T[] data, smile.math.distance.Distance<T> distance, int k)
data - the dataset for clustering.distance - the distance/dissimilarity measure.k - the number of clusters.public CLARANS(T[] data, smile.math.distance.Distance<T> distance, int k, int maxNeighbor)
data - the dataset for clustering.distance - the distance/dissimilarity measure.k - the number of clusters.maxNeighbor - the maximum number of neighbors examined during a random search of local minima.public CLARANS(T[] data, smile.math.distance.Distance<T> distance, int k, int maxNeighbor, int numLocal)
data - the dataset for clustering.distance - the distance/dissimilarity measure.k - the number of clusters.maxNeighbor - the maximum number of neighbors examined during a random search of local minima.numLocal - the number of local minima to search for.public int getNumLocalMinima()
public int getMaxNeighbor()
public double distortion()
public T[] medoids()
public int predict(T x)
predict in interface Clustering<T>x - a new instance.public java.lang.String toString()
toString in class java.lang.Object