Description Usage Arguments Value Examples
Calculate the pairwise similarity between rows of numeric matrices
1 | cosine_sim_func(a, b = NULL)
|
a |
Input matrix. |
b |
Input matrix. Optional. If 'b' is NULL, use 'a', i.e. similarity between the rows of 'a' would be computed. |
Matrix of the similarity between the rows of a and the rows of b.
1 2 3 4 | m <- matrix(1:8, ncol = 4) # a 2x4 matrix
n <- matrix(9:16, ncol = 4) # a 2x4 matrix
cosine_sim_func(m)
cosine_sim_func(m, n) # a 4x4 similarity matrix
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.