Class KMeansClustering

  • All Implemented Interfaces:
    MLClustering, MLMethod

    public class KMeansClusteringextends Objectimplements MLClustering
    This class performs a basic K-Means clustering. This class can be used on either supervised or unsupervised data. For supervised data, the ideal values will be ignored.
    • Constructor Detail

      • KMeansClustering

        public KMeansClustering(int k,                MLDataSet theSet)
        Construct the K-Means object.
        k - The number of clusters to use.
        theSet - The dataset to cluster.
    • Method Detail

      • calculateEuclideanDistance

        public static double calculateEuclideanDistance(Centroid c,                                MLData data)
        Calculate the euclidean distance between a centroid and data.
        c - The centroid to use.
        data - The data to use.
        The distance.
      • getWCSS

        public final double getWCSS()
        Within-cluster sum of squares (WCSS).
      • iteration

        public final void iteration()
        Perform a single training iteration.
        Specified by:
        iteration in interface MLClustering
      • iteration

        public final void iteration(int count)
        The number of iterations to perform.
        Specified by:
        iteration in interface MLClustering
        count - The count of iterations.
      • numClusters

        public final int numClusters()
        Specified by:
        numClusters in interface MLClustering
        The number of clusters.

SCaVis 2.2 © jWork.ORG