public class CosineSimilarity extends Object implements DistanceMeasure
A * B / (|A| * |B|) (Cosine similarity) distance between two points.| Constructor and Description |
|---|
CosineSimilarity() |
| Modifier and Type | Method and Description |
|---|---|
double |
compute(Vector a,
Vector b)
Compute the distance between two n-dimensional vectors.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, readExternal, writeExternalpublic double compute(Vector a, Vector b) throws CardinalityException
The two vectors are required to have the same dimension.
compute in interface DistanceMeasurea - The first vector.b - The second vector.CardinalityException - if the array lengths differ.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.14.0 Release Date : September 29 2022