Package elki.result

Class ClusteringVectorDumper

  • All Implemented Interfaces:
    elki.result.ResultHandler, elki.result.ResultProcessor

    public class ClusteringVectorDumper
    extends java.lang.Object
    implements elki.result.ResultHandler
    Output a clustering result in a simple and compact ascii format: whitespace separated cluster indexes

    This format can be read using ClusteringVectorParser for meta analysis, or read as clustering using ExternalClustering.

    Since:
    0.7.0
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ClusteringVectorDumper.Par
      Parameterization class.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean append
      Always append to the output file.
      private java.lang.String forceLabel
      Optional label to force for this output.
      private static elki.logging.Logging LOG
      Class logger.
      private java.nio.file.Path outputFile
      Output file.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClusteringVectorDumper​(java.nio.file.Path outputFile, boolean append)
      Constructor.
      ClusteringVectorDumper​(java.nio.file.Path outputFile, boolean append, java.lang.String forceLabel)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void dumpClusteringOutput​(java.lang.Appendable writer, Clustering<?> c)
      Dump a single clustering result.
      void processNewResult​(java.lang.Object newResult)  
      • 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
        Class logger.
      • outputFile

        private java.nio.file.Path outputFile
        Output file.
      • forceLabel

        private java.lang.String forceLabel
        Optional label to force for this output.
      • append

        private boolean append
        Always append to the output file.
    • Constructor Detail

      • ClusteringVectorDumper

        public ClusteringVectorDumper​(java.nio.file.Path outputFile,
                                      boolean append,
                                      java.lang.String forceLabel)
        Constructor.
        Parameters:
        outputFile - Output file
        append - Append to output file (overwrite otherwise).
        forceLabel - Forced label to use for the output, may be null.
      • ClusteringVectorDumper

        public ClusteringVectorDumper​(java.nio.file.Path outputFile,
                                      boolean append)
        Constructor.
        Parameters:
        outputFile - Output file
        append - Append to output file (overwrite otherwise).
    • Method Detail

      • processNewResult

        public void processNewResult​(java.lang.Object newResult)
        Specified by:
        processNewResult in interface elki.result.ResultProcessor
      • dumpClusteringOutput

        protected void dumpClusteringOutput​(java.lang.Appendable writer,
                                            Clustering<?> c)
                                     throws java.io.IOException
        Dump a single clustering result.
        Parameters:
        writer - Output writer
        c - Clustering result
        Throws:
        java.io.IOException