Recommenders: you are an arrow, and so is every movie
When Netflix, YouTube or Spotify suggests 'because you watched…'
What problem does it solve?
How can a computer tell which people (or songs) have similar taste?
The big idea
Turn each person into an arrow: one direction per movie, and the length along it is how much they liked it. People with similar taste point in similar directions, even if one rates everything high and the other rates everything low. The angle between arrows measures taste, and its cosine comes straight from the dot product. Modern systems go further and learn short 'taste vectors' (maybe 'how much action, how much romance…') for every user and item, so a predicted rating is just a dot product.
How it works, step by step
- 1. Write each person's ratings as a list of numbers, a vector.
- 2. Compute the dot product: multiply matching ratings and add them up.
- 3. Divide by the lengths of both vectors to get cos θ, between −1 and 1.
- 4. Find your most similar neighbours and recommend what they loved that you haven't seen.
The key formula
- the dot product: big when both vectors are large in the same places
- the length of the arrow (Pythagoras in many dimensions)
- 1 = identical taste direction, 0 = unrelated, −1 = opposite
How fast is it?
Comparing two users is cheap, but comparing everyone to everyone is not (millions × millions). Real services learn compact taste vectors and use fast 'approximate nearest neighbour' searches, and they mix in many other signals, such as what you watched recently and what you clicked but abandoned.
Try it yourself
- Compute cos θ between (5, 1) and (10, 2). Why is it exactly 1?
- Why might two people with cosine 0.99 still disagree about a brand-new movie?
Fun fact
From 2006 to 2009 Netflix offered $1,000,000 to anyone who could beat its recommender by 10%. The team 'BellKor's Pragmatic Chaos' won with a 10.06% improvement, but Netflix said in 2012 that it never fully deployed the winning blend because the extra accuracy didn't justify the engineering effort.