Vector.Cosine Distance<T> Method
Returns one minus the cosine similarity of two vectors.
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
C#
One minus the cosine of the angle between left and right.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
public static T CosineDistance<T>(
Vector<T> left,
Vector<T> right
)
Parameters
Type Parameters
- T
Return Value
TOne minus the cosine of the angle between left and right.
Exceptions
| Argument | left is null. -or- right is null. |
| Dimension | The length of left is not equal to the length of right. |