← Lessons

quiz vs the machine

Gold1420

Machine Learning

Collaborative Filtering

Recommend items by finding users or items that behave alike.

5 min read · core · beat Gold to climb

The core intuition

Collaborative filtering recommends items based on patterns of behavior, not item content. If you and another user agree on many items, you will probably agree on the rest.

Two flavors

  • User based finds users similar to you and recommends what they liked.
  • Item based finds items similar to ones you liked, where similarity comes from how users co rate them.
  • Item based tends to be more stable since items change behavior less than users.

How similarity works

We build a matrix of users by items filled with ratings or clicks, then measure similarity between rows or columns.

  • Cosine similarity compares the angle between two preference vectors.
  • Only the overlapping entries inform the comparison.
  • Neighbors then vote to predict a missing rating.

Strengths and limits

  • It needs no item features, only interactions.
  • It struggles with sparsity when most cells are empty.
  • It cannot rate a brand new item or user, the cold start problem.

Key idea

Collaborative filtering recommends from behavior alone by finding similar users or items, powerful without content features but limited by sparsity and cold start.

Check yourself

Answer to earn rating on the learn ladder.

1. What does collaborative filtering rely on?

2. Why is item based filtering often preferred?