sparse_pairwise
computes similarity between pairs of rows of a
matrix.
sparse_pairwise(X, id1, id2, pairwise_function, use_furrr = FALSE)
matrix
vector of integers specifying the list of rows of X
(first set)
vector of integers specifying the list of rows of X
,
(second set), same length as id1
.
function that takes a matrix and a pair of indices specifying rows of the matrix, and computes an operation of each pair of rows
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], ])
.