cos_sim | R Documentation |
Cosine similarity.
cos_sim(M)
M |
An input Matrix. Vectors are in rows: mtcars[1, ]. |
sim <- cos_sim(as.matrix(mtcars[1:3, ]))
# distances (against normalized vectors)
as.dist(1 - sim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.