matrix_similarity | R Documentation |
Cosine Similarity
cosine_match()
cosine(x, y = NULL) cosine_match(target, reference, keep_target_order = FALSE)
x |
A numeric vector or matrix |
y |
A numeric vector or matrix of the same dimensions as x |
target |
numeric matrix of j values where each row is one observation. Use row names as ID. |
reference |
numeric matrix of j values where each row is one observation. Use row names as ID. |
keep_target_order |
logical include column indicating original row order of target matrix. |
data.table containing ranked (1 = top) pairwise similarities between target and reference
## Not run: n <- 5 y <- matrix(rnorm(n * 512), ncol = 512) x <- matrix(rnorm(n * 512), ncol = 512) all.equal(cosine(x, y), text2vec::sim2(x, y)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.