|
|
|||||||||||||||||||||
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 abstract class RealVectorLabelParser<V extends RealVector<?,?>>
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 |
CLASS_LABEL_INDEX_ID
OptionID for CLASS_LABEL_INDEX_PARAM |
static IntParameter |
CLASS_LABEL_INDEX_PARAM
The parameter for an index of a numerical class label. |
protected int |
classLabelIndex
Keeps the index of an attribute 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.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
RealVectorLabelParser()
Provides a parser for parsing one point per line, attributes separated by whitespace. |
Method Summary | |
---|---|
protected abstract V |
createDBObject(List<Double> attributes)
Creates a database object of type V. |
protected abstract String |
descriptionLineType()
|
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 |
List<String> |
setParameters(List<String> args)
Grabs all specified options from the option handler. |
String |
shortDescription()
Returns a short description of the class. |
Methods inherited from class de.lmu.ifi.dbs.elki.parser.AbstractParser |
---|
toString |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable |
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 |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters |
Field Detail |
---|
private static final OptionID CLASS_LABEL_INDEX_ID
CLASS_LABEL_INDEX_PARAM
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
:
AbstractDatabaseConnection.CLASS_LABEL_INDEX_PARAM
.
The parameter is optional and the default value is set to -1.
protected int classLabelIndex
Constructor Detail |
---|
public RealVectorLabelParser()
Method Detail |
---|
public ParsingResult<V> parse(InputStream in)
Parser
parse
in interface Parser<V extends RealVector<?,?>>
in
- the stream to parse objects from
public Pair<V,List<String>> parseLine(String line)
LinebasedParser
parseLine
in interface LinebasedParser<V extends RealVector<?,?>>
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.
public String shortDescription()
AbstractParameterizable
shortDescription
in interface Parameterizable
shortDescription
in class AbstractParameterizable
protected abstract String descriptionLineType()
public List<String> setParameters(List<String> args) throws ParameterException
AbstractParameterizable
{ ListremainingParameters = super.setParameters(args); // set parameters for your class // for example like this: if(isSet(MY_PARAM_VALUE_PARAM)) { myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM); } . . . return remainingParameters; // or in case of attributes requesting parameters themselves // return parameterizableAttribbute.setParameters(remainingParameters); }
setParameters
in interface Parameterizable
setParameters
in class AbstractParameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-setting
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |