Notes

User Neighborhood

Before a user-based recommender can suggest anything, it has to decide whose opinions count. The user neighbourhood is that decision made concrete: the set of users whose histories stand in for preferences the target user has not expressed, each carrying a weight.

How a neighbourhood is formed
Every candidate is scored against the target by a similarity over the items both have touched — Pearson correlation on explicit ratings, cosine on an implicit click vector — and the set is then cut, either by a top-k count or, better, by a similarity threshold that drops weak neighbours instead of filling slots with them. Significance weighting shrinks the score of pairs with a tiny overlap, because two co-rated films can produce a perfect correlation and mean nothing at all.

It is smaller than it looks

  • Only neighbours who actually touched the candidate item contribute, so for anything obscure the working neighbourhood is a handful of people rather than k of them.
  • At the one-percent density typical of a user-item matrix, most pairs of users share no items at all and cannot be compared.
  • A gray sheep user resembles nobody closely, and the prediction quietly collapses back to catalogue popularity.

Why it is still used
Nothing is trained in advance: a user becomes recommendable as soon as they have a few interactions, and the neighbourhood updates as history grows. It also explains itself — people with your taste also watched this. The cost lands at request time, since comparing one user against millions needs an approximate-nearest-neighbour index such as FAISS, which is why production systems lean on item-item similarity and keep user neighbourhoods for smaller user bases.

A user neighbourhood is the set of users judged similar to a target user, each with a weight, from which user-based collaborative filtering predicts the target's interest in unseen items. Membership comes from a similarity over co-rated items, trimmed by a top-k cut or a similarity threshold and shrunk where the overlap is small. Its quality sets the quality of the recommendation: on a sparse interaction matrix, many users have no usable neighbourhood at all.

When you want a film suggestion, you do not ask a stadium full of strangers. You ask the handful of people whose taste has lined up with yours before.

A user neighbourhood is software doing the same thing. It compares your history of clicks, plays and ratings against everyone else's, then keeps the small group that looks most like you — neighbours in taste rather than geography. The suggestions you get are whatever that group enjoyed and you have not tried yet. The weakness is obvious once you see it: if your taste is unusual, nobody in the crowd really resembles you, and the suggestions drift back to whatever is popular with everybody.