4. Define a function that takes two vectors as input and computes their cosine similarity:
cossim(A, B) = \frac{sum(A \times B)}{\sqrt{sum(A^2) \times sum(B^2)}}
Note: your function does not need any loops as you can use the vectorized operators in
R. Test your function for correctness. For instance, the cosine similarity of any vector to
itself is 1 and cosine similarity between vectors (1,2,3) and (0,2,5) should be 0.9429
Give code, and output of cossim(c(1,2,3), c(0,2,5))