
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, valuesattributes, columnnames, curlbl, curvec, factory, haslabels, maxdim, meta, mindim, nextevent, uniquereader, 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.
|
getTypeInformationbuildMeta, cleanup, createVector, data, getMeta, initStream, isLabelColumn, nextEventasMultipleObjectsBundle, assignDBID, hasDBIDs, parseprivate 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()
NumberVectorLabelParserparseLineInternal in class SparseNumberVectorLabelParser<V extends SparseNumberVector>true when a valid line was read, false on a label
row.protected Logging getLogger()
AbstractStreamingParsergetLogger 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.