|
|
|||||||||||||||||||||
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.database.connection.AbstractDatabaseConnection<O>
O
- the type of DatabaseObject to be provided by the implementing
class as element of the supplied databasepublic abstract class AbstractDatabaseConnection<O extends DatabaseObject>
Abstract super class for all database connections. AbstractDatabaseConnection already provides the setting of the database according to parameters.
Field Summary | |
---|---|
static OptionID |
CLASS_LABEL_CLASS_ID
OptionID for CLASS_LABEL_CLASS_PARAM |
private ClassParameter<ClassLabel> |
CLASS_LABEL_CLASS_PARAM
Parameter to specify the association of occurring class labels, must extend ClassLabel . |
static OptionID |
CLASS_LABEL_INDEX_ID
OptionID for CLASS_LABEL_INDEX_PARAM |
private IntParameter |
CLASS_LABEL_INDEX_PARAM
Optional parameter that specifies the index of the label to be used as class label, must be an integer equal to or greater than 0. |
private String |
classLabelClass
Holds the value of CLASS_LABEL_CLASS_PARAM . |
protected Integer |
classLabelIndex
Holds the value of CLASS_LABEL_INDEX_PARAM , null if no class label
is specified. |
(package private) Database<O> |
database
Holds the instance of the database specified by DATABASE_PARAM . |
static OptionID |
DATABASE_ID
OptionID for DATABASE_PARAM |
private ClassParameter<Database<O>> |
DATABASE_PARAM
Parameter to specify the database to be provided by the parse method, must extend Database . |
static OptionID |
EXTERNAL_ID_INDEX_ID
OptionID for EXTERNAL_ID_INDEX_PARAM |
private IntParameter |
EXTERNAL_ID_INDEX_PARAM
Optional parameter that specifies the index of the label to be used as an external id, must be an integer equal to or greater than 0. |
private Integer |
externalIDIndex
Holds the value of EXTERNAL_ID_INDEX_PARAM . |
(package private) boolean |
forceExternalID
True, if an external label needs to be set. |
static String |
LABEL_CONCATENATION
A sign to separate components of a label. |
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 | |
---|---|
protected |
AbstractDatabaseConnection()
Adds parameters DATABASE_PARAM , CLASS_LABEL_INDEX_PARAM ,
CLASS_LABEL_CLASS_PARAM , and EXTERNAL_ID_INDEX_PARAM , to
the option handler additionally to parameters of super class. |
Method Summary | |
---|---|
protected List<Pair<O,Associations>> |
normalizeAndTransformLabels(List<Pair<O,List<String>>> objectAndLabelsList,
Normalization<O> normalization)
Normalizes and transforms the specified list of objects and their labels into a list of objects and their associations. |
List<String> |
setParameters(List<String> args)
Calls the super method and sets additionally the value of the parameters CLASS_LABEL_INDEX_PARAM , CLASS_LABEL_CLASS_PARAM , and
EXTERNAL_ID_INDEX_PARAM and instantiates database
according to the value of parameter DATABASE_PARAM . |
private List<Pair<O,Associations>> |
transformLabels(List<Pair<O,List<String>>> objectAndLabelsList)
Transforms the specified list of objects and their labels into a list of objects and their associations. |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription |
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, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.database.connection.DatabaseConnection |
---|
getDatabase |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription |
Field Detail |
---|
public static final String LABEL_CONCATENATION
public static final OptionID DATABASE_ID
DATABASE_PARAM
private final ClassParameter<Database<O extends DatabaseObject>> DATABASE_PARAM
Database
.
Default value: SequentialDatabase
Key: -dbc.database
Database<O extends DatabaseObject> database
DATABASE_PARAM
.
public static final OptionID CLASS_LABEL_INDEX_ID
CLASS_LABEL_INDEX_PARAM
private final IntParameter CLASS_LABEL_INDEX_PARAM
Key: -dbc.classLabelIndex
protected Integer classLabelIndex
CLASS_LABEL_INDEX_PARAM
, null if no class label
is specified.
public static final OptionID CLASS_LABEL_CLASS_ID
CLASS_LABEL_CLASS_PARAM
private final ClassParameter<ClassLabel> CLASS_LABEL_CLASS_PARAM
ClassLabel
.
Default value: SimpleClassLabel
Key: -dbc.classLabelClass
private String classLabelClass
CLASS_LABEL_CLASS_PARAM
.
public static final OptionID EXTERNAL_ID_INDEX_ID
EXTERNAL_ID_INDEX_PARAM
private final IntParameter EXTERNAL_ID_INDEX_PARAM
Key: -dbc.externalIDIndex
private Integer externalIDIndex
EXTERNAL_ID_INDEX_PARAM
.
boolean forceExternalID
Constructor Detail |
---|
protected AbstractDatabaseConnection()
DATABASE_PARAM
, CLASS_LABEL_INDEX_PARAM
,
CLASS_LABEL_CLASS_PARAM
, and EXTERNAL_ID_INDEX_PARAM
, to
the option handler additionally to parameters of super class.
Method Detail |
---|
public List<String> setParameters(List<String> args) throws ParameterException
CLASS_LABEL_INDEX_PARAM
, CLASS_LABEL_CLASS_PARAM
, and
EXTERNAL_ID_INDEX_PARAM
and instantiates database
according to the value of parameter DATABASE_PARAM
. The remaining
parameters are passed to the database
.
setParameters
in interface Parameterizable
setParameters
in class AbstractParameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingprotected List<Pair<O,Associations>> normalizeAndTransformLabels(List<Pair<O,List<String>>> objectAndLabelsList, Normalization<O> normalization) throws NonNumericFeaturesException
objectAndLabelsList
- the list of object and their labels to be
transformednormalization
- the normalization to be applied
NonNumericFeaturesException
- if any exception occurs during
normalizationprivate List<Pair<O,Associations>> transformLabels(List<Pair<O,List<String>>> objectAndLabelsList)
objectAndLabelsList
- the list of object and their labels to be
transformed
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |