de.lmu.ifi.dbs.elki.distance.distancefunction
Class LocallyWeightedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>>
java.lang.Object
de.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.distancefunction.AbstractDistanceFunction<O,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction<O>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractLocallyWeightedDistanceFunction<V,P>
de.lmu.ifi.dbs.elki.distance.distancefunction.LocallyWeightedDistanceFunction<V,P>
- Type Parameters:
V
- the type of RealVector to compute the distances in betweenP
- the type of Preprocessor used
- All Implemented Interfaces:
- DistanceFunction<V,DoubleDistance>, MeasurementFunction<V,DoubleDistance>, SpatialDistanceFunction<V,DoubleDistance>, PreprocessorClient<P,V>, Parameterizable
public class LocallyWeightedDistanceFunction<V extends RealVector<V,?>,P extends Preprocessor<V>>
- extends AbstractLocallyWeightedDistanceFunction<V,P>
- implements SpatialDistanceFunction<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.
- Author:
- Arthur Zimek
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocallyWeightedDistanceFunction
public LocallyWeightedDistanceFunction()
- Provides a locally weighted distance function.
distance
public DoubleDistance distance(V v1,
V v2)
- Computes the distance between two given real vectors according to this
distance function.
- Specified by:
distance
in interface DistanceFunction<V extends RealVector<V,?>,DoubleDistance>
- Parameters:
v1
- first RealVectorv2
- second RealVector
- Returns:
- the distance between two given real vectors according to this
distance function
minDist
public DoubleDistance minDist(HyperBoundingBox mbr,
V v)
- Description copied from interface:
SpatialDistanceFunction
- Computes the minimum distance between the given MBR and the FeatureVector object
according to this distance function.
- Specified by:
minDist
in interface SpatialDistanceFunction<V extends RealVector<V,?>,DoubleDistance>
- Parameters:
mbr
- the MBR objectv
- the FeatureVector object
- Returns:
- the minimum distance between the given MBR and the FeatureVector object
according to this distance function
minDist
public DoubleDistance minDist(HyperBoundingBox mbr,
Integer id)
- Description copied from interface:
SpatialDistanceFunction
- Computes the minimum distance between the given MBR and the FeatureVector object
with the given id according to this distance function.
- Specified by:
minDist
in interface SpatialDistanceFunction<V extends RealVector<V,?>,DoubleDistance>
- Parameters:
mbr
- the MBR objectid
- the id of the FeatureVector object
- Returns:
- the minimum distance between the given MBR and the FeatureVector object
according to this distance function
distance
public DoubleDistance distance(HyperBoundingBox mbr1,
HyperBoundingBox mbr2)
- Description copied from interface:
SpatialDistanceFunction
- Computes the distance between the two given MBRs
according to this distance function.
- Specified by:
distance
in interface SpatialDistanceFunction<V extends RealVector<V,?>,DoubleDistance>
- Parameters:
mbr1
- the first MBR objectmbr2
- the second MBR object
- Returns:
- the distance between the two given MBRs according to this distance function
centerDistance
public DoubleDistance centerDistance(HyperBoundingBox mbr1,
HyperBoundingBox mbr2)
- Description copied from interface:
SpatialDistanceFunction
- Computes the distance between the centroids of the two given MBRs
according to this distance function.
- Specified by:
centerDistance
in interface SpatialDistanceFunction<V extends RealVector<V,?>,DoubleDistance>
- Parameters:
mbr1
- the first MBR objectmbr2
- the second MBR object
- Returns:
- the distance between the centroids of the two given MBRs
according to this distance function
getAssociationID
public AssociationID<?> getAssociationID()
- Description copied from interface:
PreprocessorClient
- Returns the association ID for the association to be set by the preprocessor.
- Specified by:
getAssociationID
in interface PreprocessorClient<P extends Preprocessor<V>,V extends RealVector<V,?>>
- Returns:
- the association ID for the association to be set by the preprocessor,
which is
AssociationID.LOCALLY_WEIGHTED_MATRIX
.