cosine

Syntax

cosine(X, Y)

Details

Compute the cosine similarity between X and Y. The cosine similarity between X and Y, is defined as (X · Y) / (||X|| × ||Y||).

Parameters

X and Y are numeric vectors with the same number of elements.

Returns

A DOUBLE scalar.