Package de.lmu.ifi.dbs.elki.distance.distancefunction

Distance functions for use within ELKI.

See:
          Description


Interface Summary
DBIDDistanceFunction<D extends Distance<?>> Distance functions valid in a database context only (i.e. for DBIDs) For any "distance" that cannot be computed for arbitrary objects, only those that exist in the database and referenced by their ID.
DistanceFunction<O,D extends Distance<?>> Base interface for any kind of distances.
FilteredLocalPCABasedDistanceFunction<O extends NumberVector<?,?>,P extends FilteredLocalPCAIndex<? super O>,D extends Distance<D>> Interface for local PCA based preprocessors.
FilteredLocalPCABasedDistanceFunction.Instance<T extends NumberVector<?,?>,I extends Index,D extends Distance<D>> Instance produced by the distance function.
IndexBasedDistanceFunction<O,D extends Distance<D>> Distance function relying on an index (such as preprocessed neighborhoods).
IndexBasedDistanceFunction.Instance<T,I extends Index,D extends Distance<D>> Instance interface for Index based distance functions.
PrimitiveDistanceFunction<O,D extends Distance<?>> Primitive distance function that is defined on some kind of object.
PrimitiveDoubleDistanceFunction<O> Interface for distance functions that can provide a raw double value.
SpatialPrimitiveDistanceFunction<V extends SpatialComparable,D extends Distance<D>> API for a spatial primitive distance function.
SpatialPrimitiveDoubleDistanceFunction<V extends SpatialComparable> Interface combining spatial primitive distance functions with primitive number distance functions.
 

Class Summary
AbstractCosineDistanceFunction Abstract base class for Cosine and ArcCosine distances.
AbstractDatabaseDistanceFunction<O,D extends Distance<D>> Abstract super class for distance functions needing a database context.
AbstractDatabaseDistanceFunction.Instance<O,D extends Distance<D>> The actual instance bound to a particular database.
AbstractDBIDDistanceFunction<D extends Distance<D>> AbstractDistanceFunction provides some methods valid for any extending class.
AbstractIndexBasedDistanceFunction<O,I extends Index,D extends Distance<D>> Abstract super class for distance functions needing a database index.
AbstractIndexBasedDistanceFunction.Instance<O,I extends Index,D extends Distance<D>,F extends DistanceFunction<? super O,D>> The actual instance bound to a particular database.
AbstractIndexBasedDistanceFunction.Parameterizer<F extends IndexFactory<?,?>> Parameterization class.
AbstractPrimitiveDistanceFunction<O,D extends Distance<D>> AbstractDistanceFunction provides some methods valid for any extending class.
AbstractVectorDoubleDistanceFunction Abstract base class for the most common family of distance functions: defined on number vectors and returning double values.
ArcCosineDistanceFunction Cosine distance function for feature vectors.
ArcCosineDistanceFunction.Parameterizer Parameterization class.
CosineDistanceFunction Cosine distance function for feature vectors.
CosineDistanceFunction.Parameterizer Parameterization class.
EuclideanDistanceFunction Provides the Euclidean distance for FeatureVectors.
EuclideanDistanceFunction.Parameterizer Parameterization class.
LocallyWeightedDistanceFunction<V extends NumberVector<?,?>> Provides a locally weighted distance function.
LocallyWeightedDistanceFunction.Instance<V extends NumberVector<?,?>> Instance of this distance for a particular database.
LocallyWeightedDistanceFunction.Parameterizer<V extends NumberVector<?,?>> Parameterization class.
LPNormDistanceFunction Provides a LP-Norm for FeatureVectors.
LPNormDistanceFunction.Parameterizer Parameterization class.
ManhattanDistanceFunction Manhattan distance function to compute the Manhattan distance for a pair of FeatureVectors.
ManhattanDistanceFunction.Parameterizer Parameterization class.
MaximumDistanceFunction Maximum distance function to compute the Maximum distance for a pair of FeatureVectors.
MaximumDistanceFunction.Parameterizer Parameterization class.
MinimumDistanceFunction Maximum distance function to compute the Minimum distance for a pair of FeatureVectors.
MinimumDistanceFunction.Parameterizer Parameterization class.
MinKDistance<O,D extends Distance<D>> A distance that is at least the distance to the kth nearest neighbor.
MinKDistance.Parameterizer<O,D extends Distance<D>> Parameterization class.
ProxyDistanceFunction<O,D extends Distance<D>> Distance function to proxy computations to another distance (that probably was run before).
RandomStableDistanceFunction This is a dummy distance providing random values (obviously not metrical), useful mostly for unit tests and baseline evaluations: obviously this distance provides no benefit whatsoever.
RandomStableDistanceFunction.Parameterizer Parameterization class.
SharedNearestNeighborJaccardDistanceFunction<O> SharedNearestNeighborJaccardDistanceFunction computes the Jaccard coefficient, which is a proper distance metric.
SharedNearestNeighborJaccardDistanceFunction.Instance<T> Actual instance for a dataset.
SharedNearestNeighborJaccardDistanceFunction.Parameterizer<O> Parameterization class.
SquaredEuclideanDistanceFunction Provides the squared Euclidean distance for FeatureVectors.
SquaredEuclideanDistanceFunction.Parameterizer Parameterization class.
WeightedDistanceFunction Provides the Weighted distance for feature vectors.
WeightedLPNormDistanceFunction Weighted version of the Euclidean distance function.
WeightedSquaredEuclideanDistanceFunction Provides the squared Euclidean distance for FeatureVectors.
 

Package de.lmu.ifi.dbs.elki.distance.distancefunction Description

Distance functions for use within ELKI.

Distance functions

There are three basic types of distance functions:

These types differ significantly in both implementation and use.

Using distance functions

As a 'consumer' of distances, you usually do not care about the type of distance function you want to use. To facilitate this, a distance function can be bound to a database by calling the 'instantiate' method to obtain a DistanceQuery object. A distance query is a best-effort adapter for the given distance function. Usually, you pass it two DBIDs and get the distance value back. When required, the adapter will get the appropriate records from the database needed to compute the distance.

Note: instantiating a preprocessor based distance will invoke the preprocessing step. It is recommended to do this as soon as possible, and only instantiate the query once, then pass the query object through the various methods.

Code example

DistanceQuery<V, DoubleDistance> distanceQuery = database.getDistanceQuery(EuclideanDistanceFunction.STATIC);
 


Release 0.4.0 (2011-09-20_1324)