public class CosineDistanceMetric extends Object implements DistanceMetric
http://en.wikipedia.org/wiki/Cosine_similarity
,
Serialized FormConstructor and Description |
---|
CosineDistanceMetric() |
Modifier and Type | Method and Description |
---|---|
static CosineDistanceMetric |
apply() |
double |
distance(Vector a,
Vector b)
Returns the distance between the arguments.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkValidArguments
public static CosineDistanceMetric apply()
public double distance(Vector a, Vector b)
DistanceMetric
distance
in interface DistanceMetric
a
- a Vector defining a multi-dimensional point in some spaceb
- a Vector defining a multi-dimensional point in some spaceCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.