|
|
|||||||||||||||||||||
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.distance.AbstractMeasurementFunction<O,D>
de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractSimilarityFunction<O,D>
de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractPreprocessorBasedSimilarityFunction<O,SharedNearestNeighborsPreprocessor<O,D>,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.similarityfunction.FractionalSharedNearestNeighborSimilarityFunction<O,D>
O
- object typeD
- distance typepublic class FractionalSharedNearestNeighborSimilarityFunction<O extends DatabaseObject,D extends Distance<D>>
Field Summary | |
---|---|
private ArrayList<Pair<O,SortedSet<Integer>>> |
cache
Cache for objects not handled by the preprocessor |
private int |
cachesize
|
private int |
numberOfNeighbors
Holds the number of nearest neighbors to be used. |
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction |
---|
INFINITY_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 | |
---|---|
FractionalSharedNearestNeighborSimilarityFunction()
Provides a SharedNearestNeighborSimilarityFunction with a pattern defined to accept Strings that define a non-negative Integer. |
Method Summary | |
---|---|
AssociationID<SortedSet<Integer>> |
getAssociationID()
Returns the association ID for the association to be set by the preprocessor. |
String |
getDefaultPreprocessorClassName()
Returns the name of the default preprocessor. |
private SortedSet<Integer> |
getNeighbors(O obj)
Wrapper to handle objects not preprocessed with a cache for performance. |
String |
getPreprocessorDescription()
Returns the description for the preprocessor parameter. |
Class<SharedNearestNeighborsPreprocessor<O,D>> |
getPreprocessorSuperClass()
Returns the super class for the preprocessor parameter. |
DoubleDistance |
infiniteDistance()
Provides an infinite distance. |
boolean |
isInfiniteDistance(DoubleDistance distance)
Returns true, if the given distance is an infinite distance, false otherwise. |
boolean |
isNullDistance(DoubleDistance distance)
Returns true, if the given distance is a null distance, false otherwise. |
boolean |
isUndefinedDistance(DoubleDistance distance)
Returns true, if the given distance is an undefined distance, false otherwise. |
DoubleDistance |
nullDistance()
Provides a null distance. |
List<String> |
setParameters(List<String> args)
Calls the super method and passes the remaining parameters to the AbstractPreprocessorBasedSimilarityFunction.preprocessorHandler . |
DoubleDistance |
similarity(Integer id1,
Integer id2)
Returns the similarity between the two objects specified by their object ids. |
DoubleDistance |
similarity(O o1,
O o2)
Computes the similarity between two given DatabaseObjects according to this similarity function. |
DoubleDistance |
undefinedDistance()
Provides an undefined distance. |
DoubleDistance |
valueOf(String pattern)
Provides a measurement suitable to this measurement function based on the given pattern. |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractPreprocessorBasedSimilarityFunction |
---|
getPreprocessor, setDatabase |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractSimilarityFunction |
---|
similarity |
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction |
---|
getDatabase, matches, requiredInputPattern, setRequiredInputPattern, shortDescription |
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, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.similarityfunction.SimilarityFunction |
---|
similarity |
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction |
---|
requiredInputPattern, setDatabase |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription |
Field Detail |
---|
private int cachesize
private ArrayList<Pair<O extends DatabaseObject,SortedSet<Integer>>> cache
private int numberOfNeighbors
Constructor Detail |
---|
public FractionalSharedNearestNeighborSimilarityFunction()
Method Detail |
---|
public DoubleDistance similarity(Integer id1, Integer id2)
SimilarityFunction
similarity
in interface SimilarityFunction<O extends DatabaseObject,DoubleDistance>
id1
- first object idid2
- second object id
private SortedSet<Integer> getNeighbors(O obj)
obj
- query object
public DoubleDistance similarity(O o1, O o2)
SimilarityFunction
similarity
in interface SimilarityFunction<O extends DatabaseObject,DoubleDistance>
similarity
in class AbstractSimilarityFunction<O extends DatabaseObject,DoubleDistance>
o1
- first DatabaseObjecto2
- second DatabaseObject
public DoubleDistance infiniteDistance()
MeasurementFunction
infiniteDistance
in interface MeasurementFunction<O extends DatabaseObject,DoubleDistance>
public boolean isInfiniteDistance(DoubleDistance distance)
MeasurementFunction
isInfiniteDistance
in interface MeasurementFunction<O extends DatabaseObject,DoubleDistance>
distance
- the distance to be tested on infinity
public boolean isNullDistance(DoubleDistance distance)
MeasurementFunction
isNullDistance
in interface MeasurementFunction<O extends DatabaseObject,DoubleDistance>
distance
- the distance to be tested whether it is a null distance
public boolean isUndefinedDistance(DoubleDistance distance)
MeasurementFunction
isUndefinedDistance
in interface MeasurementFunction<O extends DatabaseObject,DoubleDistance>
distance
- the distance to be tested whether it is undefined
public DoubleDistance nullDistance()
MeasurementFunction
nullDistance
in interface MeasurementFunction<O extends DatabaseObject,DoubleDistance>
public DoubleDistance undefinedDistance()
MeasurementFunction
undefinedDistance
in interface MeasurementFunction<O extends DatabaseObject,DoubleDistance>
public DoubleDistance valueOf(String pattern) throws IllegalArgumentException
MeasurementFunction
valueOf
in interface MeasurementFunction<O extends DatabaseObject,DoubleDistance>
pattern
- a pattern defining a similarity suitable to this
measurement function
IllegalArgumentException
- if the given pattern is not compatible with the requirements
of this measurement functionpublic AssociationID<SortedSet<Integer>> getAssociationID()
PreprocessorClient
getAssociationID
in interface PreprocessorClient<SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,O extends DatabaseObject>
AssociationID.SHARED_NEAREST_NEIGHBORS_SET
public String getDefaultPreprocessorClassName()
PreprocessorClient
getDefaultPreprocessorClassName
in interface PreprocessorClient<SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,O extends DatabaseObject>
SharedNearestNeighborsPreprocessor
public String getPreprocessorDescription()
PreprocessorClient
getPreprocessorDescription
in interface PreprocessorClient<SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,O extends DatabaseObject>
public Class<SharedNearestNeighborsPreprocessor<O,D>> getPreprocessorSuperClass()
PreprocessorClient
getPreprocessorSuperClass
in interface PreprocessorClient<SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,O extends DatabaseObject>
SharedNearestNeighborsPreprocessor
public List<String> setParameters(List<String> args) throws ParameterException
AbstractPreprocessorBasedSimilarityFunction
AbstractPreprocessorBasedSimilarityFunction.preprocessorHandler
.
setParameters
in interface Parameterizable
setParameters
in class AbstractPreprocessorBasedSimilarityFunction<O extends DatabaseObject,SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,DoubleDistance>
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 |