Documentation of 'jsat.clustering.hierarchical.NNChainHAC' Java class
NNChainHAC
jsat.clustering.hierarchical

Class NNChainHAC

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


    public class NNChainHAC
    extends java.lang.Object
    implements KClusterer
    This class implements Hierarchical Agglomerative Clustering via the Nearest Neighbor Chain approach. This runs in O(n2) time for any Lance Williams dissimilarity and uses O(n) memory.
    This implementation also supports multi-threaded execution. see:
    • Müllner, D. (2011). Modern hierarchical, agglomerative clustering algorithms. arXiv Preprint arXiv:1109.2378. Retrieved from here
    • Murtagh, F., & Contreras, P. (2011). Methods of Hierarchical Clustering. In Data Mining and Knowledge Discovery. Wiley-Interscience.
    See Also:
    Serialized Form
    • Constructor Detail

      • NNChainHAC

        public NNChainHAC()
        Creates a new NNChainHAC using the Ward method.
      • NNChainHAC

        public NNChainHAC(LanceWilliamsDissimilarity distMeasure)
        Creates a new NNChainHAC
        Parameters:
        distMeasure - the dissimilarity measure to use
      • NNChainHAC

        public NNChainHAC(LanceWilliamsDissimilarity distMeasure,
                          DistanceMetric distance)
        Creates a new NNChain using the given dissimilarity measure and distance metric. The correctness guarantees may not hold for distances other than the Euclidean distance, which is the norm for Hierarchical Cluster.
        Parameters:
        distMeasure - the dissimilarity measure to use
        distance - the distance metric to use
    • Method Detail

      • 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[]
      • getClusterDesignations

        public int[] getClusterDesignations(int[] designations,
                                            int clusters)
        Returns the assignment array for that would have been computed for the previous data set with the desired number of clusters.
        Parameters:
        designations - the array to store the assignments in
        clusters - the number of clusters desired
        Returns:
        the original array passed in, or null if no data set has been clustered.
        See Also:
        #hasStoredClustering()
      • getClusterDesignations

        public java.util.List<java.util.List<DataPoint>> getClusterDesignations(int clusters,
                                                                                DataSet data)
        Returns the assignment array for that would have been computed for the previous data set with the desired number of clusters.
        Parameters:
        clusters - the number of clusters desired
        data -
        Returns:
        the list of data points in each cluster, or null if no data set has been clustered.
        See Also:
        #hasStoredClustering()
      • 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

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.