Documentation of 'jsat.clustering.kmeans.KMeansPDN' Java class
KMeansPDN
jsat.clustering.kmeans

Class KMeansPDN

  • All Implemented Interfaces:
    java.io.Serializable, Clusterer, KClusterer, Parameterized


    public class KMeansPDN
    extends KMeans
    This class provides a method of performing KMeans clustering when the value of K is not known. It works by incrementing the value of k up to some specified maximum, and running a full KMeans for each value.

    Note, by default this implementation uses a heuristic for the max value of K that is capped at 100 when using the Clusterer.cluster(jsat.DataSet) type methods.

    When the value of K is specified, the implementation will simply call the regular KMeans object it was constructed with. See: Pham, D. T., Dimov, S. S.,&Nguyen, C. D. (2005). Selection of K in K-means clustering. Proceedings of the Institution of Mechanical Engineers, Part C: Journal of Mechanical Engineering Science, 219(1), 103–119. doi:10.1243/095440605X8298
    See Also:
    Serialized Form
    • Constructor Detail

      • KMeansPDN

        public KMeansPDN()
        Creates a new clusterer.
      • KMeansPDN

        public KMeansPDN(KMeans kmeans)
        Creates a new clustered that uses the specified object to perform clustering for all k.
        Parameters:
        kmeans - the k-means object to use for clustering
      • KMeansPDN

        public KMeansPDN(KMeansPDN toCopy)
        Copy constructor
        Parameters:
        toCopy - the object to copy
    • Method Detail

      • getfKs

        public double[] getfKs()
        Returns the array of f(K) values generated for the last data set. The value at index i is the score for cluster i+1. Smaller values indicate better clusterings.
        Returns:
        the array of f(K) values, or null if no data set has been clustered
      • cluster

        public int[] cluster(DataSet dataSet,
                             boolean parallel,
                             int[] designations)
        Description copied from interface: Clusterer
        Performs clustering on the given data set. Parameters may be estimated by the method, or other heuristics performed.
        Specified by:
        cluster in interface Clusterer
        Overrides:
        cluster in class KMeans
        Parameters:
        dataSet - the data set to perform clustering on
        parallel - true if multiple threads should be used to perform clustering. false if it should be done in a single threaded manner.
        designations - the array which will contain the designated values. The array will be altered and returned by the function. If null is given, a new array will be created and returned.
        Returns:
        the int[]
      • cluster

        public int[] cluster(DataSet dataSet,
                             int lowK,
                             int highK,
                             boolean parallel,
                             int[] designations)
        Specified by:
        cluster in interface KClusterer
        Overrides:
        cluster in class KMeans

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.