public class DoubleVectorLabelParser extends NumberVectorLabelParser<DoubleVector>
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.
Modifier and Type | Class and Description |
---|---|
static class |
DoubleVectorLabelParser.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private static Logging |
logger
Class logger
|
LABEL_INDICES_ID, labelIndices
ATTRIBUTE_CONCATENATION, COLUMN_SEPARATOR_ID, COMMENT, NUMBER_PATTERN, QUOTE_CHAR, QUOTE_ID, quoteChar, WHITESPACE_PATTERN
Constructor and Description |
---|
DoubleVectorLabelParser()
Constructor with default values.
|
DoubleVectorLabelParser(Pattern colSep,
char quoteChar,
BitSet labelIndices)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
DoubleVector |
createDBObject(List<Double> attributes)
Creates a DoubleVector out of the given attribute values.
|
protected Logging |
getLogger()
Get the logger for this class.
|
protected VectorFieldTypeInformation<DoubleVector> |
getTypeInformation(int dimensionality)
Get a prototype object for the given dimensionality.
|
parse, parseLine, parseLineInternal
tokenize, toString
private static final Logging logger
public DoubleVectorLabelParser(Pattern colSep, char quoteChar, BitSet labelIndices)
colSep
- quoteChar
- labelIndices
- public DoubleVectorLabelParser()
public DoubleVector createDBObject(List<Double> attributes)
createDBObject
in class NumberVectorLabelParser<DoubleVector>
attributes
- the attributes of the vector to create.NumberVectorLabelParser.createDBObject(java.util.List)
protected VectorFieldTypeInformation<DoubleVector> getTypeInformation(int dimensionality)
NumberVectorLabelParser
getTypeInformation
in class NumberVectorLabelParser<DoubleVector>
dimensionality
- Dimensionalityprotected Logging getLogger()
AbstractParser
getLogger
in class AbstractParser