public class SquaredEuclideanDistanceMeasure extends Object implements DistanceMeasure
EuclideanDistanceMeasure but it does not take the square root.
Thus, it is not actually the Euclidean Distance, but it is saves on computation when you only need the
distance for comparison and don't care about the actual value as a distance.Parametered.ParameteredGeneralizationslog| Constructor and Description |
|---|
SquaredEuclideanDistanceMeasure() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.hadoop.conf.Configuration job) |
void |
createParameters(String prefix,
org.apache.hadoop.conf.Configuration jobConf)
EXPERT: consumers should never have to call this method.
|
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
|
Collection<Parameter<?>> |
getParameters() |
public void configure(org.apache.hadoop.conf.Configuration job)
configure in interface Parameteredpublic Collection<Parameter<?>> getParameters()
getParameters in interface Parameteredpublic void createParameters(String prefix, org.apache.hadoop.conf.Configuration jobConf)
ParameteredParametered.ParameteredGeneralizations if java supported it. Calling this method should create a new list of
parameters and is calledcreateParameters in interface Parameteredprefix - ends with a dot if not empty.jobConf - configuration used for retrieving valuesinvoking method,
invoking methodpublic double distance(Vector v1, Vector v2)
DistanceMeasuredistance in interface DistanceMeasurev1 - a Vector defining a multidimensional point in some feature spacev2 - a Vector defining a multidimensional point in some feature spacepublic double distance(double centroidLengthSquare,
Vector centroid,
Vector v)
DistanceMeasuredistance in interface DistanceMeasurecentroidLengthSquare - Square of the length of centroidcentroid - Centroid vectorCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.