|
|
|||||||||||||||||||||
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.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.parser.AbstractParser<V>
de.lmu.ifi.dbs.elki.parser.RealVectorLabelParser<V>
V
- the type of RealVector expected in the ParsingResult
public class RealVectorLabelParser<V extends RealVector<V,?>>
Provides a parser for parsing one point per line, attributes separated by whitespace.
The parser provides a parameter for parsing the real values as
doubles (default) (resulting in a ParsingResult
of
DoubleVector
s) or float (resulting in a ParsingResult
of
FloatVector
s).
Several labels may be given per point. A label must not be parseable as double (or float). 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 | |
---|---|
static String |
CLASS_LABEL_INDEX_D
Description for the parameter numerical class label. |
static String |
CLASS_LABEL_INDEX_P
The parameter name for an index of a numerical class label. |
static IntParameter |
CLASS_LABEL_INDEX_PARAM
The parameter for an index of a numerical class label. |
private int |
classLabelIndex
Keeps the index of an attribute to be treated as a string label. |
static String |
FLOAT_D
Description for parameter float. |
static String |
FLOAT_F
Option string for parameter float. |
protected boolean |
parseFloat
If true, the real values are parsed as floats. |
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.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug |
Constructor Summary | |
---|---|
RealVectorLabelParser()
Provides a parser for parsing one point per line, attributes separated by whitespace. |
Method Summary | |
---|---|
String |
description()
Returns a description of the class and the required parameters. |
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. |
String[] |
setParameters(String[] args)
Sets the attributes of the class accordingly to the given parameters. |
Methods inherited from class de.lmu.ifi.dbs.elki.parser.AbstractParser |
---|
toString, usage |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, checkGlobalParameterConstraints, deleteOption, description, description, getAttributeSettings, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, getAttributeSettings, getParameters, getPossibleOptions, inlineDescription |
Field Detail |
---|
public static final String FLOAT_F
public static final String FLOAT_D
protected boolean parseFloat
public static final String CLASS_LABEL_INDEX_P
public static final String CLASS_LABEL_INDEX_D
public static final IntParameter CLASS_LABEL_INDEX_PARAM
AbstractDatabaseConnection
.
A non-numerical class label can be directly selected from the labels after parsing via the
corresponding parameter of the AbstractDatabaseConnection
:
CLASS_LABEL_INDEX_P
.
The parameter is optional and the default value is set to -1.
private int classLabelIndex
Constructor Detail |
---|
public RealVectorLabelParser()
Method Detail |
---|
public ParsingResult<V> parse(InputStream in)
Parser
in
- the stream to parse objects from
Parser.parse(java.io.InputStream)
public String description()
Parameterizable
description
in interface Parameterizable
description
in class AbstractParameterizable
Parameterizable.description()
public String[] setParameters(String[] args) throws ParameterException
Parameterizable
setParameters
in interface Parameterizable
setParameters
in class AbstractParameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingParameterizable.setParameters(String[])
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |