cosine_simi {opticskxi} | R Documentation |
Cosine similarity between vectors and/or matrices.
Description
Inputs will be L2 normalized, then matrix multiplied (y is transposed). If second input is missing, first input will be recycled, which enables to efficiently compute cosine similarities between the rows of a rectangular matrix.
Usage
cosine_simi(x, y)
Arguments
x |
Numeric vector or matrix |
y |
Numeric vector or matrix. If missing, copied from parameter x. |
Value
Symmetric numeric similarity matrix
[Package opticskxi version 1.2.1 Index]