I didn’t do the course yet, forgive me if I understand it wrong.
Basically, we are discussing how close the vectors are.
Cosine similarity is much simpler to understand when the vectors modules are equal to 1.
In this case, the cosine similarity
(a . b . cos (𝜃))
will be reduced to cos(𝜃) that is, magically, the product of the matrices.
Let’s get 2 vectors in x, y bidimensional space:
A = [x1, y1] at an horizontal angle of 𝜃1
B = [x2, y2] at an horizontal angle of 𝜃2
if they are normalized, the cosine similarity or dot product between them will be
∣A∣ * ∣B∣ * cos(𝜃3)
where 𝜃3 = 𝜃2 - 𝜃1
and ∣A∣ = ∣B∣ = 1
but
cos( 𝜃2 - 𝜃1) = cos( 𝜃2)*cos( 𝜃1) + sen( 𝜃2)*sen( 𝜃1)
so, applying it to the definitions
cos(𝜃_{1} ) = \frac {x_{1}}{A} = x_{1}
sen(𝜃_{1} ) = \frac {y_{1}}{A} = y_{1}
we get that the cosine similarity will be:
x_{1} * x_{2} + y_{1} * y_{2}
As
A = [x1, y1]
and
B = [x2, y2]
Then the cosine similarity or dot product will be
A * B
We can see this also from the definition of cosine similarity:
cosine similarity=
CS=\frac {A * B}{|A|*|B|}
If the vectors are not normalized, the calculation gets much more complicated:
CS=\frac {x_{1}*x_{2}+y_{1}*y_{2}}{\sqrt{x_{1}^{2}+y_{1}^{2}}*\sqrt{x_{2}^{2}+y_{2}^{2}}}