KMeansClustering
org.encog.ml.kmeans

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. http://en.wikipedia.org/wiki/Kmeans
    • Constructor Detail

      • KMeansClustering

        public KMeansClustering(int k,                MLDataSet theSet)
        Construct the K-Means object.
        Parameters:
        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.
        Parameters:
        c - The centroid to use.
        data - The data to use.
        Returns:
        The distance.
      • getWCSS

        public final double getWCSS()
        Returns:
        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
        Parameters:
        count - The count of iterations.
      • numClusters

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

SCaVis 2.1 © jWork.ORG