Class ByLabelHierarchicalClustering

  • All Implemented Interfaces:
    elki.Algorithm, ClusteringAlgorithm<Clustering<Model>>

    @Title("Hierarchical clustering by label")
    @Description("Cluster points by a (pre-assigned!) label. For comparing results with a reference clustering.")
    @Priority(-105)
    public class ByLabelHierarchicalClustering
    extends java.lang.Object
    implements ClusteringAlgorithm<Clustering<Model>>
    Pseudo clustering using labels.

    This "algorithm" puts elements into the same cluster when they agree in their labels. I.e. it just uses a predefined clustering, and is mostly useful for testing and evaluation (e.g., comparing the result of a real algorithm to a reference result / golden standard).

    This variant derives a hierarchical result by doing a prefix comparison on labels.

    TODO: Noise handling (e.g., allow the user to specify a noise label pattern?)

    TODO: allow specifying a separator character

    Since:
    0.2
    Author:
    Erich Schubert
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface elki.Algorithm

        elki.Algorithm.Utils
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static elki.logging.Logging LOG
      The logger for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void assign​(java.util.HashMap<java.lang.String,​elki.database.ids.DBIDs> labelMap, java.lang.String label, elki.database.ids.DBIDRef id)
      Assigns the specified id to the labelMap according to its label
      Clustering<Model> autorun​(elki.database.Database database)  
      elki.data.type.TypeInformation[] getInputTypeRestriction()  
      Clustering<Model> run​(elki.database.relation.Relation<?> relation)
      Run the actual clustering algorithm.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final elki.logging.Logging LOG
        The logger for this class.
    • Constructor Detail

      • ByLabelHierarchicalClustering

        public ByLabelHierarchicalClustering()
        Constructor without parameters
    • Method Detail

      • run

        public Clustering<Model> run​(elki.database.relation.Relation<?> relation)
        Run the actual clustering algorithm.
        Parameters:
        relation - The data input to use
      • assign

        private void assign​(java.util.HashMap<java.lang.String,​elki.database.ids.DBIDs> labelMap,
                            java.lang.String label,
                            elki.database.ids.DBIDRef id)
        Assigns the specified id to the labelMap according to its label
        Parameters:
        labelMap - the mapping of label to ids
        label - the label of the object to be assigned
        id - the id of the object to be assigned
      • getInputTypeRestriction

        public elki.data.type.TypeInformation[] getInputTypeRestriction()
        Specified by:
        getInputTypeRestriction in interface elki.Algorithm