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, parse
private 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)
StreamingParser
initStream
in interface StreamingParser
initStream
in class AbstractStreamingParser
in
- the stream to parse objects frompublic BundleStreamSource.Event nextEvent()
BundleStreamSource
public Object data(int rnum)
BundleStreamSource
rnum
- Representation numberpublic BundleMeta getMeta()
BundleStreamSource
protected Logging getLogger()
AbstractStreamingParser
getLogger
in class AbstractStreamingParser
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.