Package elki.result
Class ClusteringVectorDumper
- java.lang.Object
-
- elki.result.ClusteringVectorDumper
-
- All Implemented Interfaces:
ResultHandler,ResultProcessor
public class ClusteringVectorDumper extends java.lang.Object implements ResultHandler
Output a clustering result in a simple and compact ascii format: whitespace separated cluster indexesThis format can be read using
ClusteringVectorParserfor meta analysis, or read as clustering usingExternalClustering.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClusteringVectorDumper.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description private booleanappendAlways append to the output file.private java.lang.StringforceLabelOptional label to force for this output.private static LoggingLOGClass logger.private java.nio.file.PathoutputFileOutput 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 voiddumpClusteringOutput(java.lang.Appendable writer, Clustering<?> c)Dump a single clustering result.voidprocessNewResult(java.lang.Object newResult)Process a result.
-
-
-
Field Detail
-
LOG
private static final 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 fileappend- Append to output file (overwrite otherwise).forceLabel- Forced label to use for the output, may benull.
-
ClusteringVectorDumper
public ClusteringVectorDumper(java.nio.file.Path outputFile, boolean append)Constructor.- Parameters:
outputFile- Output fileappend- Append to output file (overwrite otherwise).
-
-
Method Detail
-
processNewResult
public void processNewResult(java.lang.Object newResult)
Description copied from interface:ResultProcessorProcess a result.- Specified by:
processNewResultin interfaceResultProcessor- Parameters:
newResult- Newly added result subtree.
-
dumpClusteringOutput
protected void dumpClusteringOutput(java.lang.Appendable writer, Clustering<?> c) throws java.io.IOExceptionDump a single clustering result.- Parameters:
writer- Output writerc- Clustering result- Throws:
java.io.IOException
-
-