Cos_Distance | R Documentation |
Cos_Distance function
Cos_Distance(X, v)
X |
n x m matrix |
v |
1 x m vector |
column matrix of the (Cosine Similarity) Distances calculated between the rows of X and the vector v
X = matrix(c(1,1,0,1,1,0), nrow = 2, byrow = FALSE) v = c(0,0,1) Cos_Distance(X,v) # Returns the following: # [0.2928932, 1.0000000]'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.