Class ExternalClustering

  • All Implemented Interfaces:
    Algorithm, ClusteringAlgorithm<Clustering<? extends Model>>

    @Description("Load clustering results from an external file. Each line is expected to consists of one clustering, one integer per point and an (optional) non-numeric label.")
    public class ExternalClustering
    extends java.lang.Object
    implements ClusteringAlgorithm<Clustering<? extends Model>>
    Read an external clustering result from a file, such as produced by ClusteringVectorDumper.

    The input format of this parser is text-based:

     # Optional comment
     1 1 1 2 2 2 -1 Example label
    Where non-negative numbers are cluster assignments, negative numbers are considered noise clusters.
    Erich Schubert
    • Field Summary

      Modifier and Type Field Description
      static java.lang.String COMMENT
      The comment character.
      private file
      The file to be reparsed.
      private static Logging LOG
      The logger for this class.
    • Constructor Summary

      Constructor Description
      ExternalClustering​( file)
    • Field Detail

      • LOG

        private static final Logging LOG
        The logger for this class.
      • COMMENT

        public static final java.lang.String COMMENT
        The comment character.
        See Also:
        Constant Field Values
      • file

        private file
        The file to be reparsed.
    • Constructor Detail

      • ExternalClustering

        public ExternalClustering​( file)
        file - File to load
    • 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
        Type restriction
      • attachToRelation

        private void attachToRelation​(Relation<?> r,
                                      it.unimi.dsi.fastutil.ints.IntArrayList assignment,
                                      java.util.ArrayList<java.lang.String> name)
        Build a clustering from the file result.
        r - Result to attach to
        assignment - Cluster assignment
        name - Name