Centered Cosine Similarity
Two people can agree completely about films and still look like strangers to a similarity score, because one hands out fours and fives while the other never goes above three. Centered cosine similarity removes that difference before comparing them.
Subtract the mean, then take the cosine
Each user's rating vector has that user's own mean rating subtracted from its observed entries, and cosine similarity is computed on the centred vectors. The score runs from -1 to 1 and the sign is informative: positive means the pair rate the same items above and below their respective averages, zero means no relationship, negative means systematic disagreement. Restricted to the items both users rated, this is algebraically Pearson correlation — the same computation under another name. Adjusted cosine similarity is its item-item counterpart, centring each rating by the rater's mean instead.
Why centring is not cosmetic
Three things change once the means come out:
- User rating bias disappears, so a harsh rater and a lenient one with identical taste land in each other's neighbourhoods.
- In a sparse implementation, unobserved entries sit at zero, which after centring means that user's own average — a sensible neutral, where raw cosine would read a missing rating as the worst possible score.
- Disagreement becomes usable: a negative similarity is evidence, and neighbourhood prediction formulas weight by it rather than discarding it.
Where it needs help
The score is unstable on thin overlap — two users with two co-rated items can hit a perfect 1 by coincidence — which is what significance weighting shrinks. And it needs ratings to centre, so on implicit feedback, where every observation is a one, this family gives way to cosine over binary vectors or to learned embeddings.
Centered cosine similarity compares two rating vectors after subtracting each user's own mean rating, then takes the cosine of the centred vectors. Centring cancels the difference between generous and harsh raters, so users with matching taste but different scales score as similar, and systematic disagreement shows up as a negative score. Over co-rated items it is algebraically Pearson correlation, and it is the default similarity in user-based collaborative filtering.
Suppose two friends rate films out of five and agree about everything — except that one is generous, handing out fours and fives, while the other never goes above three. Compare their scores side by side and they look like strangers.
Centered cosine similarity fixes that by asking a better question. Not what you scored a film, but whether you scored it above or below your own average. Once both friends are measured against their own habits, their agreement is obvious. Recommendation software uses this to find the people whose taste genuinely matches yours, rather than the people who happen to rate things the way you do — and then suggests what those people liked and you have not seen.