Class XMeans

java.lang.Object
smile.clustering.XMeans

public class XMeans extends Object
X-Means clustering algorithm, an extended K-Means which tries to automatically determine the number of clusters based on BIC scores. Starting with only one cluster, the X-Means algorithm goes into action after each run of K-Means, making local decisions about which subset of the current centroids should split themselves in order to better fit the data. The splitting decision is done by computing the Bayesian Information Criterion (BIC).

References

  1. Dan Pelleg and Andrew Moore. X-means: Extending K-means with Efficient Estimation of the Number of Clusters. ICML, 2000.
See Also:
  • Method Details

    • fit

      public static CentroidClustering<double[],double[]> fit(double[][] data, int kmax, int maxIter)
      Clustering data with the number of clusters determined by X-Means algorithm automatically.
      Parameters:
      data - the input data of which each row is an observation.
      kmax - the maximum number of clusters.
      maxIter - the maximum number of iterations for k-means.
      Returns:
      the model.
    • fit

      public static CentroidClustering<double[],double[]> fit(double[][] data, Clustering.Options options)
      Clustering data with the number of clusters determined by X-Means algorithm automatically.
      Parameters:
      data - the input data of which each row is an observation.
      options - the hyperparameters.
      Returns:
      the model.