sim2
calculates pairwise similarities between the
rows of two data matrices. Note that some methods work only on sparse matrices and
others work only on dense matrices.
psim2
calculates "parallel" similarities between the rows of two data matrices.
sim2(x, y = NULL, method = c("cosine", "jaccard"), norm = c("l2",
"none"))psim2(x, y, method = c("cosine", "jaccard"), norm = c("l2", "none"))
sim2
returns matrix
of similarities between each row of
matrix x
and each row of matrix y
.
psim2
returns vector
of "parallel" similarities between rows of x
and y
.
first matrix.
second matrix. For sim2
y = NULL
set by default.
This means that we will assume y = x
and calculate similarities between all rows of the x
.
character
, the similarity measure to be used. One of c("cosine", "jaccard")
.
character = c("l2", "none")
- how to scale input matrices. If they already scaled - use "none"
Computes the similarity matrix using given method.
psim2
takes two matrices and return a single vector.
giving the ‘parallel’ similarities of the vectors.