V
- Vector typepublic class LibSVMFormatParser<V extends SparseNumberVector> extends SparseNumberVectorLabelParser<V>
<label> <index1>:<value1> <index2>:<value2> ...i.e. a mandatory integer class label in the beginning followed by a classic sparse vector representation of the data. indexes are integers, starting at 1 (Note that ELKI uses 0-based indexing, so we will map these to index-1) to not always have a constant-0 dimension 0. The FAQ states that you can also put comments into the file, separated by a dash: #, but they must not contain colons and are not officially supported. ELKI will simply stop parsing a line when encountering a #.
Modifier and Type | Class and Description |
---|---|
static class |
LibSVMFormatParser.Parameterizer<V extends SparseNumberVector>
Parameterization class.
|
BundleStreamSource.Event
Modifier and Type | Field and Description |
---|---|
static Pattern |
COMMENT_PATTERN
Comment pattern.
|
private static Logging |
LOG
Class logger.
|
static Pattern |
WHITESPACE_PATTERN
LibSVM uses whitespace and colons for separation.
|
labels, sparsefactory, values
attributes, columnnames, curlbl, curvec, factory, haslabels, maxdim, meta, mindim, nextevent, unique
reader, tokenizer
Constructor and Description |
---|
LibSVMFormatParser(SparseNumberVector.Factory<V> factory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Logging |
getLogger()
Get the logger for this class.
|
protected boolean |
parseLineInternal()
Internal method for parsing a single line.
|
getTypeInformation
buildMeta, cleanup, createVector, data, getMeta, initStream, isLabelColumn, nextEvent
asMultipleObjectsBundle, assignDBID, hasDBIDs, parse
private static final Logging LOG
public static final Pattern WHITESPACE_PATTERN
public static final Pattern COMMENT_PATTERN
public LibSVMFormatParser(SparseNumberVector.Factory<V> factory)
factory
- Vector factoryprotected boolean parseLineInternal()
NumberVectorLabelParser
parseLineInternal
in class SparseNumberVectorLabelParser<V extends SparseNumberVector>
true
when a valid line was read, false
on a label
row.protected Logging getLogger()
AbstractStreamingParser
getLogger
in class SparseNumberVectorLabelParser<V extends SparseNumberVector>
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.