Class NaiveAgglomerativeHierarchicalClustering1<O>

  • Type Parameters:
    O - Object type
    All Implemented Interfaces:
    Algorithm

    public class NaiveAgglomerativeHierarchicalClustering1<O>
    extends java.lang.Object
    implements Algorithm
    This tutorial will step you through implementing a well known clustering algorithm, agglomerative hierarchical clustering, in multiple steps.

    This is the first step, where we implement it with single linkage only, and extract a fixed number of clusters. The follow up variants will be made more flexible.

    This is the naive O(n³) algorithm. See SLINK for a much faster algorithm (however, only for single-linkage).

    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Detail

      • LOG

        private static final Logging LOG
        Class logger
      • distance

        Distance<? super O> distance
        Distance function used.
      • numclusters

        int numclusters
        Threshold, how many clusters to extract.
    • Constructor Detail

      • NaiveAgglomerativeHierarchicalClustering1

        public NaiveAgglomerativeHierarchicalClustering1​(Distance<? super O> distance,
                                                         int numclusters)
        Constructor.
        Parameters:
        distance - Distance function to use
        numclusters - Number of clusters
    • Method Detail

      • getInputTypeRestriction

        public TypeInformation[] getInputTypeRestriction()
        Description copied from interface: Algorithm
        Get the input type restriction used for negotiating the data query.
        Specified by:
        getInputTypeRestriction in interface Algorithm
        Returns:
        Type restriction
      • run

        public Clustering<Model> run​(Relation<O> relation)
        Perform HAC
        Parameters:
        relation - Data relation
        Returns:
        Clustering