sparse_pairwise | R Documentation |
sparse_pairwise
computes similarity between pairs of rows of a
matrix.
sparse_pairwise(X, id1, id2, pairwise_function, use_furrr = FALSE)
X |
matrix |
id1 |
vector of integers specifying the list of rows of |
id2 |
vector of integers specifying the list of rows of |
pairwise_function |
function that takes a matrix and a pair of indices specifying rows of the matrix, and computes an operation of each pair of rows |
use_furrr |
boolean indicating whether to use the furrr library for parallel processing. |
data.frame with the same number of rows as the length of id1
(and id2
) containing the similarity between the pairs of rows
of X
. sim[i] == pairwise_function(X[id1[i], ], X[id2[i], ])
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.