|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser<V>
V
- the type of NumberVector usedpublic abstract class NumberVectorLabelParser<V extends NumberVector<?,?>>
Provides a parser for parsing one point per line, attributes separated by whitespace.
Several labels may be given per point. A label must not be parseable as double. Lines starting with "#" will be ignored.
An index can be specified to identify an entry to be treated as class label. This index counts all entries (numeric and labels as well) starting with 0.
Nested Class Summary | |
---|---|
static class |
NumberVectorLabelParser.Parameterizer<V extends NumberVector<?,?>>
Parameterization class. |
Field Summary | |
---|---|
static OptionID |
LABEL_INDICES_ID
A comma separated list of the indices of labels (may be numeric), counting whitespace separated entries in a line starting with 0. |
protected BitSet |
labelIndices
Keeps the indices of the attributes to be treated as a string label. |
Fields inherited from class de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser |
---|
ATTRIBUTE_CONCATENATION, COLUMN_SEPARATOR_ID, COMMENT, NUMBER_PATTERN, QUOTE_CHAR, QUOTE_ID, quoteChar, WHITESPACE_PATTERN |
Constructor Summary | |
---|---|
NumberVectorLabelParser(Pattern colSep,
char quoteChar,
BitSet labelIndices)
Constructor |
Method Summary | |
---|---|
protected abstract V |
createDBObject(List<Double> attributes)
Creates a database object of type V. |
protected abstract VectorFieldTypeInformation<V> |
getTypeInformation(int dimensionality)
Get a prototype object for the given dimensionality. |
MultipleObjectsBundle |
parse(InputStream in)
Returns a list of the objects parsed from the specified input stream. |
SingleObjectBundle |
parseLine(String line)
Parse a single line into a database object |
protected Pair<V,LabelList> |
parseLineInternal(String line)
Internal method for parsing a single line. |
Methods inherited from class de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser |
---|
getLogger, tokenize, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final OptionID LABEL_INDICES_ID
Key: -parser.labelIndices
protected BitSet labelIndices
Constructor Detail |
---|
public NumberVectorLabelParser(Pattern colSep, char quoteChar, BitSet labelIndices)
colSep
- quoteChar
- labelIndices
- Method Detail |
---|
public MultipleObjectsBundle parse(InputStream in)
Parser
parse
in interface Parser
in
- the stream to parse objects from
public SingleObjectBundle parseLine(String line)
LinebasedParser
parseLine
in interface LinebasedParser
line
- single line
protected Pair<V,LabelList> parseLineInternal(String line)
line
- Line to process
protected abstract V createDBObject(List<Double> attributes)
Creates a database object of type V.
attributes
- the attributes of the vector to create.
protected abstract VectorFieldTypeInformation<V> getTypeInformation(int dimensionality)
dimensionality
- Dimensionality
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |