cosine | R Documentation |
Column-by-column Euclidean norm cosine similarity for a matrix, pair of matrices, pair of vectors, or pair of a vector and matrix. Supports sparse matrices.
cosine(x, y = NULL)
x |
matrix or vector of, or coercible to, class "dgCMatrix" or "sparseVector" |
y |
(optional) matrix or vector of, or coercible to, class "dgCMatrix" or "sparseVector" |
This function takes advantage of extremely fast vector operations and is able to handle very large datasets.
cosine
applies a Euclidean norm to provide very similar results to Pearson correlation. Note that negative values may be returned due to the use of Euclidean normalization when all associations are largely random.
This function adopts the sparse matrix computational strategy applied by qlcMatrix::cosSparse
, and extends it to any combination of single and/or pair of sparse matrix and/or dense vector.
dense matrix, vector, or value giving cosine distances
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.