User-Based Collaborative Filtering

User-based collaborative filtering finds users whose rows in the utility matrix resemble the target user’s row, then recommends what those neighbors liked. It is the most literal form of collaborative filtering: “people with histories like yours also liked this.”

User-user prediction

With similarity , a rating-style prediction is

For binary interactions, the numerator is often just a weighted sum of neighbor item indicators. Item-based collaborative filtering flips the similarity computation to columns.

Worked example

For target user U0 with ratings , cosine similarity compares U0’s rating vector with each other user’s vector:

UserRatingsSimilarity to U0Contribution to unseen items
U01.000Target user; already-seen items are filtered.
U10.964Strong neighbor; contributes to item 2.
U20.096Weak neighbor; contributes little.
U30.000No overlap with U0’s rated items.

After filtering items 0 and 1, item 2 receives the strongest neighbor-weighted support because the nearest user rated it. Matrix factorization can be viewed as replacing this local neighbor lookup with a global low-rank model.

Caveats

User neighborhoods are unstable when users have few interactions or rapidly changing tastes. Computing user-user similarities is expensive in systems with many users. New users need onboarding, content-based recommendation, or exploration before neighbor scores are meaningful.

References