|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.parser.AbstractParser<V>
de.lmu.ifi.dbs.elki.parser.NumberVectorLabelParser<V>
V
- the type of NumberVector expected in the ParsingResult
public 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.
Field Summary | |
---|---|
private static OptionID |
LABEL_INDICES_ID
OptionID for LABEL_INDICES_PARAM |
private IntListParameter |
LABEL_INDICES_PARAM
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.parser.AbstractParser |
---|
ATTRIBUTE_CONCATENATION, COMMENT, WHITESPACE_PATTERN |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
NumberVectorLabelParser(Parameterization config)
Constructor, adhering to Parameterizable |
Method Summary | |
---|---|
protected abstract V |
createDBObject(List<Double> attributes)
Creates a database object of type V. |
ParsingResult<V> |
parse(InputStream in)
Returns a list of the objects parsed from the specified input stream and a list of the labels associated with the objects. |
Pair<V,List<String>> |
parseLine(String line)
Parse a single line into a database object |
Methods inherited from class de.lmu.ifi.dbs.elki.parser.AbstractParser |
---|
toString |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final OptionID LABEL_INDICES_ID
LABEL_INDICES_PARAM
private final IntListParameter LABEL_INDICES_PARAM
Key: -parser.labelIndices
protected BitSet labelIndices
Constructor Detail |
---|
public NumberVectorLabelParser(Parameterization config)
Parameterizable
config
- ParameterizationMethod Detail |
---|
public ParsingResult<V> parse(InputStream in)
Parser
parse
in interface Parser<V extends NumberVector<?,?>>
in
- the stream to parse objects from
public Pair<V,List<String>> parseLine(String line)
LinebasedParser
parseLine
in interface LinebasedParser<V extends NumberVector<?,?>>
line
- single line
protected abstract V createDBObject(List<Double> attributes)
Creates a database object of type V.
attributes
- the attributes of the vector to create.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |