O
- object class to processpublic abstract class AbstractSimilarityAdapter<O> extends AbstractDatabaseDistanceFunction<O,DoubleDistance>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractSimilarityAdapter.Instance<O>
Inner proxy class for SNN distance function.
|
static class |
AbstractSimilarityAdapter.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
static OptionID |
SIMILARITY_FUNCTION_ID
Parameter to specify the similarity function to derive the distance between
database objects from.
|
protected NormalizedSimilarityFunction<? super O,? extends NumberDistance<?,?>> |
similarityFunction
Holds the similarity function.
|
Constructor and Description |
---|
AbstractSimilarityAdapter(NormalizedSimilarityFunction<? super O,? extends NumberDistance<?,?>> similarityFunction)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
DoubleDistance |
getDistanceFactory()
Method to get the distance functions factory.
|
TypeInformation |
getInputTypeRestriction()
Get the input data type of the function.
|
abstract <T extends O> |
instantiate(Relation<T> database)
Instantiate with a database to get the actual distance query.
|
boolean |
isSymmetric()
Is this function symmetric?
|
isMetric
public static final OptionID SIMILARITY_FUNCTION_ID
NormalizedSimilarityFunction
.
Key: -adapter.similarityfunction
Default value:
FractionalSharedNearestNeighborSimilarityFunction
protected NormalizedSimilarityFunction<? super O,? extends NumberDistance<?,?>> similarityFunction
public AbstractSimilarityAdapter(NormalizedSimilarityFunction<? super O,? extends NumberDistance<?,?>> similarityFunction)
similarityFunction
- Similarity function to use.public TypeInformation getInputTypeRestriction()
DistanceFunction
public boolean isSymmetric()
DistanceFunction
isSymmetric
in interface DistanceFunction<O,DoubleDistance>
isSymmetric
in class AbstractDatabaseDistanceFunction<O,DoubleDistance>
true
when symmetricpublic DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<O,DoubleDistance>
getDistanceFactory
in class AbstractDatabaseDistanceFunction<O,DoubleDistance>
public abstract <T extends O> DistanceQuery<T,DoubleDistance> instantiate(Relation<T> database)
DistanceFunction
database
- The representation to use