Cosine vector to matrix

cosine_x_to_m(x, m)

Arguments

x

numeric vector

m

numeric matrix

Value

vector of cosine similarities between x and m

Examples

vec <- c(1,2,3) mat <- matrix(c(1,2,3,3,2,1,2,1,3),ncol=3) cosine_x_to_m(vec,mat)
#> [,1] #> [1,] 0.9285714 #> [2,] 0.8017837 #> [3,] 0.8583951