Difficulty: Easy Tags: Linear Algebra
LinkedIn's "People You May Know" starts as raw cosine similarity between two profile embedding vectors before any graph signal is layered on top.
cos(u, v) = (u . v) / (||u|| * ||v||)
d
u_1 ... u_d
v_1 ... v_d
Scalar similarity, 6 decimals.
1 <= d <= 10^4Input
4
1 2 0 1
2 0 1 1
Output
0.500000
No results yet
Run your code to check it against the examples, or submit to run every test.