org.apache.mahout.common.distance
Interface DistanceMeasure
- All Superinterfaces:
- Parametered
- All Known Implementing Classes:
- ChebyshevDistanceMeasure, CosineDistanceMeasure, EuclideanDistanceMeasure, MahalanobisDistanceMeasure, ManhattanDistanceMeasure, MinkowskiDistanceMeasure, SquaredEuclideanDistanceMeasure, TanimotoDistanceMeasure, WeightedDistanceMeasure, WeightedEuclideanDistanceMeasure, WeightedManhattanDistanceMeasure
public interface DistanceMeasure
- extends Parametered
This interface is used for objects which can determine a distance metric between two points
Fields inherited from interface org.apache.mahout.common.parameters.Parametered |
log |
Method Summary |
double |
distance(double centroidLengthSquare,
Vector centroid,
Vector v)
Optimized version of distance metric for sparse vectors. |
double |
distance(Vector v1,
Vector v2)
Returns the distance metric applied to the arguments |
distance
double distance(Vector v1,
Vector v2)
- Returns the distance metric applied to the arguments
- Parameters:
v1
- a Vector defining a multidimensional point in some feature spacev2
- a Vector defining a multidimensional point in some feature space
- Returns:
- a scalar doubles of the distance
distance
double distance(double centroidLengthSquare,
Vector centroid,
Vector v)
- Optimized version of distance metric for sparse vectors. This distance computation requires operations
proportional to the number of non-zero elements in the vector instead of the cardinality of the vector.
- Parameters:
centroidLengthSquare
- Square of the length of centroidcentroid
- Centroid vector
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.