Notes

Memory-Based CF

The oldest working recommender does something almost embarrassingly direct: it keeps the interaction history itself, and when a prediction is needed it hunts for the rows or columns most like the one in front of it. Nothing is fitted in advance. That is memory-based collaborative filtering.

How a prediction is produced
Two symmetrical variants exist. User-user CF finds the users most similar to the target — by cosine or Pearson correlation over the items they both rated — and predicts an item's score as their similarity-weighted average, usually after subtracting each neighbour's mean so individual rating habits cancel out. Item-item CF does the same along the columns: the score for an unseen item is a weighted average of the user's own ratings on the items most similar to it. Item-item is the variant that scaled, because item similarities drift far more slowly than user taste, so the similarity table can be precomputed offline and merely read at serving time.

What it buys and what it costs

  • New interactions take effect at once — there is no retraining step between a click and its influence on the next page.
  • The reasoning is legible, which is where "because you watched…" comes from.
  • Sparsity hurts badly: two users overlapping on three items yield a similarity that is mostly noise.
  • The cost moves to query time, and neighbourhood search over a large catalogue is why model-based factorisation displaced it as the main ranker.

Where it still sits
Memory-based scoring remains a strong candidate generator inside a multi-stage recommender, where fresh co-interaction signal is exactly what a learned embedding is slowest to absorb.

Memory-based collaborative filtering predicts directly from the stored user-item matrix: it finds the most similar users or items using a measure such as cosine similarity, then takes a similarity-weighted average of their ratings. Nothing is trained in advance, so a new interaction counts immediately and recommendations are easy to explain. It suffers under sparsity and pushes its cost to query time, which is why model-based methods took over at catalogue scale.

This is the recommendation idea everyone already uses without naming it. You want something to watch, so you ask the friends whose taste matches yours and go with what they liked. Or you work the other way round: you loved one particular film, so you look for the films most like it.

Memory-based collaborative filtering is software doing exactly that, at scale. It keeps the whole record of who liked what, and when a suggestion is needed it searches that record for the closest matches there and then. Nothing is worked out in advance. The appeal is that it can always say why — because people like you liked this — and the drawback is that all the work happens while you wait.