Collaborative Filtering in Recommendation System

Rabin Poudyal
3 min readJun 23, 2018

In my previous article, I talked about content based recommendation system. If you have not checked that post yet, I highly recommend you to read that first and come back to this post. This is necessary because collaborative filtering approach aims to solve the problem of content based filtering. In content based filtering, the problem was we need to identify certain factors that would influence the user to buy the products. The problem of that approach was that those hidden factors should be manually discovered and the expert should manually map the products against those factors. For example the factors that influence users to buy shoes could be brand of shoe, color of shoe, size, price and more. These factors should be discovered for both users and products.

It would be better if we could recommend the products to users without having to know about the products themselves. Here product can be just anything it could be movies, news, goods in e-commerce store. Collaborative filtering is made for recommending products or contents to the users without having to know about those products or contents themselves. Unlike the content based filtering, this filtering does not require any description of products to recommend them to users. We also don’t need the product descriptors like author of book, genres of movies, brand of shoes and so on.

So how is this possible? Let’s take an example on how would we usually find which books we would love to read, which restaurant we might like to go or which dish we may like to eat in the new restaurant? In real life, we ask our nearest people like best friends, partner that match our preferences( e.g who likes the same movie as we do) to get a recommendation for which movie to watch or to do things we have not done before. This is the idea behind collaborative filtering. This is where the word “collaborative” comes into play. It means that users collaborate each other or help each other to find the products they might buy or to navigate the catalog of products they might be interested in. If a user likes something and if he tells that he likes that thing to someone who has similar preference as him, then they can help each other to find products of their preference quickly.

So if we have a data of user’s preferences like (negative or positive)ratings they have given to the movies, or what genres of song they like, or which brand they like then we could find other users who match the closest preferences of the them and recommend products users of same preferences liked in the past.

Collaborative filtering is a broad term and it is the mother of other algorithms that are based on user’s preferences. Any algorithms that relies on user’s behavior like their browsing history, their ratings or similarity between users to recommend the products is said to be collaborative filtering algorithm.

The goal of collaborative filtering is to predict the ratings that the user would give to the products that they have not rated yet. Rating can be explicit or implicit. Explicit rating can be number of stars or score they have given to the product or reviews they have given to the product directly. The rating users would give to the product could also be number of clicks, time the user spend on that page, purchases made by them, searches for that product and more. They are the the implicit ratings.

Inputs and Outputs:

Input for collaborative filtering:

History of user’s rating of products in the past. It could be explicit or implicit ratings as discussed above.

Output given by collaborative filtering:

Rating the user would give to the products that (s)he has not rated yet.

Now, after you get the output you can sort them and show the top picks to that user or personalize the homepage for them to recommend those products.

As I already told you we have lot of options to look about users to recommend them products, this leads to many algorithms that uses collaborative filtering concept to recommend products to users. These are:

  1. Latent factor based methods and
  2. Nearest neighbour based methods

I will discuss these algorithms in my next articles. If you like this post, don’t forget to clap the post and follow me on medium and on twitter.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Rabin Poudyal
Rabin Poudyal

Written by Rabin Poudyal

Software Engineer, Data Science Practitioner. Say "Hi!" via email: rabinpoudyal1995@gmail.com or visit my website https://rabinpoudyal.com.np

No responses yet

Write a response