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

Class KMeans

    • Field Detail

      • DEFAULT_SEED_SELECTION

        public static final SeedSelectionMethods.SeedSelection DEFAULT_SEED_SELECTION
        This is the default seed selection method used in ElkanKMeans. When used with the EuclideanDistance, it selects seeds that are log optimal with a high probability.
    • Method Detail

      • setIterationLimit

        public void setIterationLimit(int iterLimit)
        Sets the maximum number of iterations allowed
        Parameters:
        iterLimit - the maximum number of iterations of the ElkanKMeans algorithm
      • getIterationLimit

        public int getIterationLimit()
        Returns the maximum number of iterations of the ElkanKMeans algorithm that will be performed.
        Returns:
        the maximum number of iterations of the ElkanKMeans algorithm that will be performed.
      • setStoreMeans

        public void setStoreMeans(boolean storeMeans)
        If set to true the computed means will be stored after clustering is completed, and can then be retrieved using getMeans().
        Parameters:
        storeMeans - true if the means should be stored for later, false to discard them once clustering is complete.
      • getMeans

        public java.util.List<Vec> getMeans()
        Returns the raw list of means that were used for each class.
        Returns:
        the list of means for each class
      • getDistanceMetric

        public DistanceMetric getDistanceMetric()
        Returns the distance metric in use
        Returns:
        the distance metric in use
      • cluster

        public int[] cluster(DataSet dataSet,
                             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
        Parameters:
        dataSet - the data set to perform clustering on
        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:
        an array indicating for each value indicating the cluster designation. This is the same array as designations, or a new one if the input array was null
      • 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
        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 clusters,
                             boolean parallel,
                             int[] designations)
        Specified by:
        cluster in interface KClusterer
      • cluster

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

        public boolean supportsWeightedData()
        Description copied from interface: Clusterer
        Indicates whether the model knows how to cluster using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.
        Specified by:
        supportsWeightedData in interface Clusterer
        Returns:
        true if the model supports weighted data, false otherwise

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.