de.lmu.ifi.dbs.elki.distance.distancefunction
Class LocallyWeightedDistanceFunction<V extends NumberVector<?,?>>
java.lang.Object
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDatabaseDistanceFunction<O,D>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction<V,FilteredLocalPCAIndex<V>,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.LocallyWeightedDistanceFunction<V>
- Type Parameters:
V
- the type of NumberVector to compute the distances in between
- All Implemented Interfaces:
- DistanceFunction<V,DoubleDistance>, FilteredLocalPCABasedDistanceFunction<V,FilteredLocalPCAIndex<V>,DoubleDistance>, IndexBasedDistanceFunction<V,DoubleDistance>, InspectionUtilFrequentlyScanned, Parameterizable
public class LocallyWeightedDistanceFunction<V extends NumberVector<?,?>>
- extends AbstractIndexBasedDistanceFunction<V,FilteredLocalPCAIndex<V>,DoubleDistance>
- implements FilteredLocalPCABasedDistanceFunction<V,FilteredLocalPCAIndex<V>,DoubleDistance>
Provides a locally weighted distance function. Computes the quadratic form
distance between two vectors P and Q as follows:
result = max{distP(P,Q), distQ(Q,P)} where
distX(X,Y) = (X-Y)*MX*(X-Y)T
and MX is the weight matrix of vector X.
LocallyWeightedDistanceFunction
public LocallyWeightedDistanceFunction(LocalProjectionIndex.Factory<V,FilteredLocalPCAIndex<V>> indexFactory)
- Constructor
- Parameters:
indexFactory
- Index factory
getDistanceFactory
public DoubleDistance getDistanceFactory()
- Description copied from interface:
DistanceFunction
- Method to get the distance functions factory.
- Specified by:
getDistanceFactory
in interface DistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
- Specified by:
getDistanceFactory
in class AbstractDatabaseDistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
- Returns:
- Factory for distance objects
isMetric
public boolean isMetric()
- Description copied from interface:
DistanceFunction
- Is this distance function metric (in particular, does it satisfy the
triangle equation?)
- Specified by:
isMetric
in interface DistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
- Overrides:
isMetric
in class AbstractIndexBasedDistanceFunction<V extends NumberVector<?,?>,FilteredLocalPCAIndex<V extends NumberVector<?,?>>,DoubleDistance>
- Returns:
true
when metric.
isSymmetric
public boolean isSymmetric()
- Description copied from interface:
DistanceFunction
- Is this function symmetric?
- Specified by:
isSymmetric
in interface DistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
- Overrides:
isSymmetric
in class AbstractIndexBasedDistanceFunction<V extends NumberVector<?,?>,FilteredLocalPCAIndex<V extends NumberVector<?,?>>,DoubleDistance>
- Returns:
true
when symmetric
instantiate
public <T extends V> LocallyWeightedDistanceFunction.Instance<T> instantiate(Relation<T> database)
- Description copied from interface:
FilteredLocalPCABasedDistanceFunction
- Instantiate with a database to get the actual distance query.
- Specified by:
instantiate
in interface DistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
- Specified by:
instantiate
in interface FilteredLocalPCABasedDistanceFunction<V extends NumberVector<?,?>,FilteredLocalPCAIndex<V extends NumberVector<?,?>>,DoubleDistance>
- Parameters:
database
- The representation to use
- Returns:
- Actual distance query.
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object