|
|
|||||||||||||||||||||
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.preprocessing.SharedNearestNeighborsPreprocessor<O,D>
O
- the type of database objects the preprocessor can be applied toD
- the type of distance the used distance function will returnpublic class SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>
A preprocessor for annotation of the ids of nearest neighbors to each database object.
The k nearest neighbors are assigned based on an arbitrary distance function. The association is annotated using the association idAssociationID.SHARED_NEAREST_NEIGHBORS_SET
.
Field Summary | |
---|---|
static ClassParameter<DistanceFunction> |
DISTANCE_FUNCTION_PARAM
Parameter to indicate the distance function to be used to ascertain the nearest neighbors. |
private DistanceFunction<O,D> |
distanceFunction
Hold the distance funciton to be used. |
static IntParameter |
NUMBER_OF_NEIGHBORS_PARAM
Parameter to indicate the number of neighbors to be taken into account for the shared-nearest-neighbor similarity. |
private int |
numberOfNeighbors
Holds the number of nearest neighbors to be used. |
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 | |
---|---|
SharedNearestNeighborsPreprocessor()
Provides a SharedNearestNeighborPreprocessor. |
Method Summary | |
---|---|
String |
description()
Provides a short description of the purpose of this class. |
AssociationID<SortedSet> |
getAssociationID()
Provides the association id used for annotation of the nearest neighbors. |
void |
run(Database<O> database,
boolean verbose,
boolean time)
Annotates the nearest neighbors based on the values of numberOfNeighbors
and distanceFunction to each database object. |
String[] |
setParameters(String[] args)
Sets the parameter values of NUMBER_OF_NEIGHBORS_PARAM
and DISTANCE_FUNCTION_PARAM
to numberOfNeighbors and
distanceFunction , respectively. |
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, toString, 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 IntParameter NUMBER_OF_NEIGHBORS_PARAM
Default value: 1
Key: sharedNearestNeighbors
public static final ClassParameter<DistanceFunction> DISTANCE_FUNCTION_PARAM
Default value: EuklideanDistanceFunction
Key: SNNDistanceFunction
private int numberOfNeighbors
private DistanceFunction<O extends DatabaseObject,D extends Distance<D>> distanceFunction
Constructor Detail |
---|
public SharedNearestNeighborsPreprocessor()
Method Detail |
---|
public void run(Database<O> database, boolean verbose, boolean time)
numberOfNeighbors
and distanceFunction
to each database object.
run
in interface Preprocessor<O extends DatabaseObject>
database
- the database for which the preprocessing is performedverbose
- flag to allow verbose messages while performing the algorithmtime
- flag to request output of performance timePreprocessor.run(de.lmu.ifi.dbs.elki.database.Database,boolean,boolean)
public String[] setParameters(String[] args) throws ParameterException
NUMBER_OF_NEIGHBORS_PARAM
and DISTANCE_FUNCTION_PARAM
to numberOfNeighbors
and
distanceFunction
, respectively.
setParameters
in interface Parameterizable
setParameters
in class AbstractParameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingAbstractParameterizable.setParameters(java.lang.String[])
public AssociationID<SortedSet> getAssociationID()
AssociationID.SHARED_NEAREST_NEIGHBORS_SET
)public String description()
description
in interface Parameterizable
description
in class AbstractParameterizable
AbstractParameterizable.description()
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |