Class KModes
java.lang.Object
smile.clustering.KModes
K-Modes clustering. K-Modes is the binary equivalent for K-Means.
The mean update for centroids is replaced by the mode one which is
a majority vote among element of each cluster.
References
- Joshua Zhexue Huang. Clustering Categorical Data with k-Modes.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic CentroidClustering<int[], int[]> fit(int[][] data, int k, int maxIter) Fits k-modes clustering.static CentroidClustering<int[], int[]> fit(int[][] data, Clustering.Options options) Fits k-modes clustering.
-
Method Details
-
fit
Fits k-modes clustering.- Parameters:
data- the input data of which each row is an observation.k- the number of clusters.maxIter- the maximum number of iterations.- Returns:
- the model.
-
fit
Fits k-modes clustering.- Parameters:
data- the input data of which each row is an observation.options- the hyperparameters.- Returns:
- the model.
-