CosineDistance

CosineDistance[u,v]

gives the angular cosine distance between vectors u and v.

Details

Examples

open allclose all

Basic Examples  (2)

Cosine distance between two vectors:

Cosine distance between numeric vectors:

Scope  (2)

Compute distance between any vectors of equal length:

Compute distance between vectors of any precision:

Applications  (1)

Cluster data using cosine distance:

Properties & Relations  (3)

Cosine distance includes a dot product scaled by norms:

Cosine distance includes a dot product scaled by Euclidean distances from the origin:

CosineDistance of vectors shifted by their means is equivalent to CorrelationDistance:

Introduced in 2007
 (6.0)