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

Class KernelKMeans

    • Constructor Detail

      • KernelKMeans

        public KernelKMeans(KernelTrick kernel)
        Parameters:
        kernel - the kernel to use
      • KernelKMeans

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

      • setMaximumIterations

        public void setMaximumIterations(int iterLimit)
        Sets the maximum number of iterations allowed
        Parameters:
        iterLimit - the maximum number of iterations of the KMeans algorithm
      • getMaximumIterations

        public int getMaximumIterations()
        Returns the maximum number of iterations of the KMeans algorithm that will be performed.
        Returns:
        the maximum number of iterations of the KMeans algorithm that will be performed.
      • 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 lowK,
                             int highK,
                             boolean parallel,
                             int[] designations)
        Specified by:
        cluster in interface KClusterer
      • cluster

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

        public double distance(Vec x,
                               int k)
        Returns the distance between the given data point and the the specified cluster
        Parameters:
        x - the data point to get the distance for
        k - the cluster id to get the distance to
        Returns:
        the distance between the given data point and the specified cluster
      • distance

        public double distance(Vec x,
                               java.util.List<java.lang.Double> qi,
                               int k)
        Returns the distance between the given data point and the the specified cluster
        Parameters:
        x - the data point to get the distance for
        qi - the query information for the given data point generated for the kernel in use. See KernelTrick.getQueryInfo(jsat.linear.Vec)
        k - the cluster id to get the distance to
        Returns:
        the distance between the given data point and the specified cluster
      • findClosestCluster

        public int findClosestCluster(Vec x)
        Finds the cluster ID that is closest to the given data point
        Parameters:
        x - the data point to get the closest cluster for
        Returns:
        the index of the closest cluster
      • findClosestCluster

        public int findClosestCluster(Vec x,
                                      java.util.List<java.lang.Double> qi)
        Finds the cluster ID that is closest to the given data point
        Parameters:
        x - the data point to get the closest cluster for
        qi - the query information for the given data point generated for the kernel in use. See KernelTrick.getQueryInfo(jsat.linear.Vec)
        Returns:
        the index of the closest cluster
      • meanToMeanDistance

        public double meanToMeanDistance(int k0,
                                         int k1)
        Computes the distance between two of the means in the clustering
        Parameters:
        k0 - the index of the first mean
        k1 - the index of the second mean
        Returns:
        the distance between the two
      • 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.