How collaborative filtering works
Recommendation systems use collaborative filtering to identify and predict behavioral patterns, e.g. what we ‘like’, buy, watch, listen to, etc. In ‘item-based collaborative filtering’, you compare two items each time and determine the overlap between two users for these items. The bigger the overlap, the stronger the similarities between both items. In ‘user-based collaborative filtering’, you determine the overlap in items between two users. This gives you an idea of how comparable the users are. To make relevant recommendations, the system identifies the most similar user and takes an item the initial user doesn’t already have.
For example, if users A and B both like almost all the same series on Netflix, but user B has seen (and liked) Stranger Things and user A hasn’t yet, Netflix will likely recommend this series to user A. To be able to do this, collaborative filtering requires a large number of active users to make accurate predictions and/or recommendations. The more data you have, the better the recommendations will be.
We can predict whether user E will want the headphones by comparing his tastes with those of users who have indicated similar tastes in other items. In this case, the distance between users B and E is the same as the distance between users C and E: both have 2 items overlap. Since B and C are the most similar users, and both don’t want the headphone, there’s a good chance E won’t want the headphone either.