Leverage Turing Intelligence capabilities to integrate AI into your operations, enhance automation, and optimize cloud migration for scalable impact.
Advance foundation model research and improve LLM reasoning, coding, and multimodal capabilities with Turing AGI Advancement.
Access a global network of elite AI professionals through Turing Jobs—vetted experts ready to accelerate your AI initiatives.
Collaborative filtering recommender systems have played a significant role in the rise of web services and content platforms like Amazon, Netflix, YouTube, etc. in recent years. In this age of information, knowing what the customer wants before they even know it themselves is nothing short of a superpower. As the name suggests, recommender system algorithms are used to offer relevant content or product to the consumer based on their taste or previous choices. In this article, we will look at how a particular type of recommender system works: collaborative recommender system.
There are two types of recommender systems, content-based filtering and collaborative filtering. Content-based filtering uses machine learning algorithms to predict and recommend new, yet similar, items to users. It uses item features to group similar items together.
Collaborative filtering solely uses past interactions between the customers and the products they’ve used to recommend new items. Item features are not important since user-item interactions are used and are stored in the user-item interactions matrix.
In collaborative filtering, all the users are taken into consideration and people with similar tastes and preferences are used to suggest new and specific products to the primary customer. It helps companies and customers keep up with what’s trending.
Two types of interactions between users and products are recorded:
Here’s an example for a clearer idea:
It's the weekend and you have nothing to do so you decide to watch a new movie. You plan to make an evening out of it and invite your friend over who has a similar taste in movies. He brings the new Doctor Strange movie since he knows you like sci-fi action even though you haven’t actually watched a superhero movie before. You end up loving Doctor Strange and look forward to watching the other Marvel movies to know the whole story.
All this was possible because you trusted that your friend knows your taste and would suggest something you had a high probability of liking. Collaborative filtering algorithms work in much the same way and suggest new content and products based on the behavior of similar customers.
Back in 2006, Netflix offered a prize to solve a simple problem that had been around for years. It was to find the best collaborative algorithm to predict user ratings for films that they haven't watched yet, based on previous ratings of other movies.
Today, e-commerce giants continue to try to solve this problem in a better way by observing users’ past behavior to predict what other things the same user will like. Why? Because knowing what to offer in advance can boost their bottom line by increasing sales and enhancing customer experience.
Recommendations also help customers discover new products and offers that they’re not explicitly looking for, thus speeding up the search process. This allows companies to send out personalized newsletters via email that offer new TV shows, movies, products, and services that are better suited for them.
One of the most significant advantages of modern recommendation algorithms is their ability to take implicit feedback and suggest new content/products, thus staying up-to-date with customers’ preferences. This enables businesses to continue catering to customers even if their tastes change over time.
In collaborative filtering, we ignore the features of an individual item. Instead, we focus on a similar group of people using the item and recommend other items that the group likes.
Similar users are divided into small clusters and are recommended new items according to the preferences of that cluster. Let’s understand this with an easy movie recommendation example:
Image source: GeeksforGeeks
What we can infer from this user-item matrix is:
This is the logic behind employing a user-item interaction matrix - to find clusters of similar users through collaborative filtering.
The two types of collaborative filtering approaches are:
Image source: Iterators
In memory-based collaborative filtering, only the user-item interaction matrix is utilized to make new recommendations to users. The whole process is based on the users’ previous ratings and interactions.
Memory-based filtering consists of 2 methods: user-based collaborative filtering and item-based collaborative filtering.
To suggest new recommendations to a particular user, a group of similar users (nearest neighbors) is created based on the interactions of the reference user. The items that are most popular in this group, but new to the target user, are used for the suggestions.
Image source: Towards Data Science
In item-based filtering, new recommendations are selected based on the old interactions of the target user. First, all the items that the user has already liked are considered. Then, similar products are computed and clusters are made (nearest neighbors). New items from these clusters are suggested to the user.
Image source: Towards Data Science
In the model-based approach, machine learning models are used to predict and rank interactions between users and the items they haven’t interacted with yet. These models are trained using the interaction information already available from the interaction matrix by deploying different algorithms like matrix factorization, deep learning, clustering, etc.
Matrix factorization is used to generate latent features by decomposing the sparse user-item interaction matrix into two smaller and dense matrices of user and item entities.
Going back to our movie example, let’s assume we have a sparse matrix of 4 users and 4 movies, the ratings ranging from 1 to 5:
Image source: GeeksforGeeks
Since not all the movies are viewed and rated by every user, we end up with a sparse matrix. To create a model for our matrix, we can assume that:
We do not provide these features explicitly, but let the model discover the useful features and make its user and item matrices. As the features are learned and not provided, they have mathematical correlation and meaning but no intuitive understanding.
Image source: Towards Data Science
In this article, we discussed the collaborative filtering approach to recommender systems, and how it leverages the user-item interaction matrix to make suggestions. We also discussed the different types of collaborative filtering, namely memory-based and model-based approaches. The memory-based approach can be further divided into user-based and item-based collaborative filtering, depending on whether the user or the item was considered as central for giving suggestions. We then looked at the different pros and cons of using collaborative filtering, and why it’s one of the best choices for recommendation systems.
Author is a seasoned writer with a reputation for crafting highly engaging, well-researched, and useful content that is widely read by many of today's skilled programmers and developers.