org.apache.flink.ml.metrics.distances
Returns the distance between the arguments.
Returns the distance between the arguments.
a Vector defining a multi-dimensional point in some space
a Vector defining a multi-dimensional point in some space
a scalar double of the distance
This class implements a cosine distance metric. The class calculates the distance between the given vectors by dividing the dot product of two vectors by the product of their lengths. We convert the result of division to a usable distance. So, 1 - cos(angle) is actually returned.
http://en.wikipedia.org/wiki/Cosine_similarity