distances {text2vec} | R Documentation |
Pairwise Distance Matrix Computation
Description
dist2
calculates pairwise distances/similarities between the
rows of two data matrices. Note that some methods work only on sparse matrices and
others work only on dense matrices.
pdist2
calculates "parallel" distances between the rows of two data matrices.
Usage
dist2(x, y = NULL, method = c("cosine", "euclidean", "jaccard"),
norm = c("l2", "l1", "none"))
pdist2(x, y, method = c("cosine", "euclidean", "jaccard"),
norm = c("l2", "l1", "none"))
Arguments
x |
first matrix. |
y |
second matrix. For |
method |
usually |
norm |
|
Details
Computes the distance matrix computed by using the specified method. Similar to dist function, but works with two matrices.
pdist2
takes two matrices and return a single vector.
giving the ‘parallel’ distances of the vectors.
Value
dist2
returns matrix
of distances/similarities between each row of
matrix x
and each row of matrix y
.
pdist2
returns vector
of "parallel" distances between rows
of x
and y
.