Class KModes

java.lang.Object
smile.clustering.KModes

public class KModes extends Object
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

  1. Joshua Zhexue Huang. Clustering Categorical Data with k-Modes.
See Also:
  • Method Details

    • fit

      public static CentroidClustering<int[],int[]> fit(int[][] data, int k, int maxIter)
      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

      public static CentroidClustering<int[],int[]> fit(int[][] data, Clustering.Options options)
      Fits k-modes clustering.
      Parameters:
      data - the input data of which each row is an observation.
      options - the hyperparameters.
      Returns:
      the model.