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
ClusteringVectorParser
for 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 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 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)
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:ResultProcessor
Process a result.- Specified by:
processNewResult
in interfaceResultProcessor
- Parameters:
newResult
- Newly added result subtree.
-
dumpClusteringOutput
protected void dumpClusteringOutput(java.lang.Appendable writer, Clustering<?> c) throws java.io.IOException
Dump a single clustering result.- Parameters:
writer
- Output writerc
- Clustering result- Throws:
java.io.IOException
-
-