public class KModes extends CentroidClustering<int[],int[]>
KMeans
,
Serialized Formcentroids, distance, distortion
k, OUTLIER, size, y
Constructor and Description |
---|
KModes(double distortion,
int[][] centroids,
int[] y)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static KModes |
fit(int[][] data,
int k)
Fits k-modes clustering.
|
static KModes |
fit(int[][] data,
int k,
int maxIter)
Fits k-modes clustering.
|
compareTo, predict, toString
run, seed
public KModes(double distortion, int[][] centroids, int[] y)
distortion
- the total distortion.centroids
- the centroids of each cluster.y
- the cluster labels.public static KModes fit(int[][] data, int k)
data
- the input data of which each row is an observation.k
- the number of clusters.public static KModes fit(int[][] data, int k, int maxIter)
data
- the input data of which each row is an observation.k
- the number of clusters.maxIter
- the maximum number of iterations.