Collaborative Filtering: An Interesting Guide For 2021

Ajay Ohri


If you are from a tech background,  it is highly probable that you are familiar with the word Collaborative Filtering and recommendation systems. Looking forward, this article provides you with a clear understanding of collaborative filtering and, in turn, various implementations of it.

Collaborative filtering is a very common technique used for the development of recommendation in an automated way.  The taste of similar users are identified, and this is used in the prediction of users interest.

In this article let us look at:

  1. Types of Collaborative Filtering Techniques 
  2. Python Implementations
  3. Comparison 

1. Types of collaborative filtering techniques 

There involved huge research in the context of collaborative filtering, and finally, the most widely used methods are based on model-based matrix factorization, i.e. factor models which are low dimensional. They are Memory based approach and the Model-based approach. For instance, if we wish to recommend any further new one to the users, you can use one among the many techniques discussed below.

Memory-based application: 

Here, the similarity of users are discovered based on similarity of cosine or in other way based on Pearson correlation and thereafter, weight average is done. The main advantage is easy to create and also easy to an explanation. And coming to a disadvantage,  performance will be reduced in the case where data is scattered. Memory-Based Collaborative filtering can be divided into two parts or sections. They are user-item filtering and item-item filtering.  

User-item collaborative filtering selects a particular user and taking a similar rating as a base, and it finds the users who are similar to this particular user. In item-item filtering, taking item as a base, it finds the users who liked the particular item and then found the same or similar kind of items that those similar users liked. Generally, a recommendation uses items, outputs and others. “Users who liked this product also liked ”   indicates an item-item memory-based collaborative filtering .” Users who are similar to you also liked ”  indicates a user-item memory-based collaborative filtering.

For instance,  let’s take A and B are two persons who have liked similar movies or given ratings to a similar movie.  Our job here is to find the rating for the target user in a similar movie. The following are the steps involved in user-item filtering in this regard: 

  • Identify the targeted user.
  • Then find alike users who also have similar or close ratings to this target user.
  • Find the items which are never bought or connected to this specific user.
  • Guess or predict the ratings of this uninteracted item for a specifically targeted user.
  • If the ratings which are predicted are above the limit,  then you can recommend them to the specifically targeted user.

The steps involved in an item-item filtering are : 

  • Identify the specifically targeted user.
  • Takings the ratings of the item by this target user as a base; find other similar or close items which have the same or close ratings.
  • Then, the prediction should be done for items of similar nature.
  • If the ratings are predicted above the limit, then you can recommend them to the specifically targeted user.

Item-item collaborative filtering is generally more popular as similarity predicted between items is more successful and reliable than that of similarity between users. Item-item collaborative filtering’s are more stable than user-item collaborative filtering when situations change.

Model-Based Collaborative filtering 

Model-Based Collaborative filtering is done using machine learning algorithms in order to predict user uninteracted items. Model-based filtering can further be subdivided into three kinds. They are the Non-Parametric Approach,  Matrix factorization based Algorithm, Deep learning. The non-parametric approach is the approach where similarity is identified based on an unsupervised learning model. In this method,  the number of similar users is also limited.

Thus this makes it more scalable. Matrix factorization is a method in which preferences or attitudes of a user is found by less number of hidden factors which are called Embeddings. One important algorithm to factorize a matrix is singular value decomposition(SVD). Deep learning can be considered as an extension of the matrix factorization algorithm. This can be the best method.

2. Python Implementations

Let us here discuss the above two major important packages of python, which give a lot of various algorithm options to choose from.

Surprise package 

It has been specially made for the ease of recommendation based on collaborative filtering. A default implementation is there for a variety of collaborative filtering algorithms. library is a huge python library that makes deep learning and machine learning easy for many people who has basic coding skills.

3. Comparison 

Among the available six different recommendation systems,  collaborative filtering is one of such most commonly used recommendation algorithms. It also has the edge over content-based filtering, where the former goes with user-user recommendations and the latter on user preferences for product features. Even in collaborative Filtering techniques, Neural net or Deep learning and  Singular value decomposition (SVD) gives out and out best results. 


Collaborative Filtering does not need features about the items or users to be known. Collaborative filtering recommender systems can help recommenders not specializing in a user’s profile. No domain knowledge is necessary in the case of collaborative filtering. It also has a great starting point and involves serendipity. Thus It is the best technique for recommendations.

If you are interested in making a career in the Data Science domain, our 11-month in-person Postgraduate Certificate Diploma in Data Science course can help you immensely in becoming a successful Data Science professional. 


Related Articles

Please wait while your application is being created.
Request Callback