
public class ClusteringVectorParser extends AbstractStreamingParser
ClusteringVectorDumper.
This allows reading the output of multiple clustering runs, and
analyze the results using ELKI algorithm.
The input format is very simple, each line containing a sequence of cluster
assignments in integer form, and an optional label:
0 0 1 1 0 First 0 0 0 1 2 Secondrepresents two clusterings for 5 objects. The first clustering has two clusters, the second contains three clusters. TODO: this parser currently is quite hacky, and could use a cleanup. TODO: support noise, via negative cluster numbers?
| Modifier and Type | Class and Description |
|---|---|
static class |
ClusteringVectorParser.Parameterizer
Parameterization class.
|
BundleStreamSource.Event| Modifier and Type | Field and Description |
|---|---|
(package private) gnu.trove.list.array.TIntArrayList |
buf1
Buffers, will be reused.
|
(package private) Clustering<Model> |
curclu
Current clustering.
|
(package private) LabelList |
curlbl
Current labels.
|
(package private) boolean |
haslbl
Flag if labels are present.
|
(package private) ArrayList<String> |
lbl
Buffer for labels.
|
private static Logging |
LOG
Class logger.
|
protected BundleMeta |
meta
Metadata.
|
(package private) BundleStreamSource.Event |
nextevent
Event to report next.
|
(package private) int |
numterms
Number of different terms observed.
|
(package private) DBIDRange |
range
Range of the DBID values.
|
reader, tokenizer| Constructor and Description |
|---|
ClusteringVectorParser(CSVReaderFormat format)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
data(int rnum)
Access a particular object and representation.
|
protected Logging |
getLogger()
Get the logger for this class.
|
BundleMeta |
getMeta()
Get the current meta data.
|
void |
initStream(InputStream in)
Init the streaming parser for the given input stream.
|
BundleStreamSource.Event |
nextEvent()
Get the next event
|
asMultipleObjectsBundle, assignDBID, cleanup, hasDBIDs, parseprivate static final Logging LOG
int numterms
protected BundleMeta meta
BundleStreamSource.Event nextevent
Clustering<Model> curclu
LabelList curlbl
gnu.trove.list.array.TIntArrayList buf1
DBIDRange range
boolean haslbl
public ClusteringVectorParser(CSVReaderFormat format)
format - Input formatpublic void initStream(InputStream in)
StreamingParserinitStream in interface StreamingParserinitStream in class AbstractStreamingParserin - the stream to parse objects frompublic BundleStreamSource.Event nextEvent()
BundleStreamSourcepublic Object data(int rnum)
BundleStreamSourcernum - Representation numberpublic BundleMeta getMeta()
BundleStreamSourceprotected Logging getLogger()
AbstractStreamingParsergetLogger in class AbstractStreamingParserCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.