|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.common.distance.SquaredEuclideanDistanceMeasure
org.apache.mahout.common.distance.EuclideanDistanceMeasure
public class EuclideanDistanceMeasure
This class implements a Euclidean distance metric by summing the square root of the squared differences between each coordinate.
If you don't care about the true distance and only need the values for comparison, then the base class,SquaredEuclideanDistanceMeasure
, will be faster since it doesn't do the actual square root of the
squared differences.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.mahout.common.parameters.Parametered |
---|
Parametered.ParameteredGeneralizations |
Field Summary |
---|
Fields inherited from interface org.apache.mahout.common.parameters.Parametered |
---|
log |
Constructor Summary | |
---|---|
EuclideanDistanceMeasure()
|
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 |
Methods inherited from class org.apache.mahout.common.distance.SquaredEuclideanDistanceMeasure |
---|
configure, createParameters, getParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EuclideanDistanceMeasure()
Method Detail |
---|
public double distance(Vector v1, Vector v2)
DistanceMeasure
distance
in interface DistanceMeasure
distance
in class SquaredEuclideanDistanceMeasure
v1
- a Vector defining a multidimensional point in some feature spacev2
- a Vector defining a multidimensional point in some feature space
public double distance(double centroidLengthSquare, Vector centroid, Vector v)
DistanceMeasure
distance
in interface DistanceMeasure
distance
in class SquaredEuclideanDistanceMeasure
centroidLengthSquare
- Square of the length of centroidcentroid
- Centroid vector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |