Predicting top picks for user using collaborative filtering

Rabin Poudyal
3 min readJun 26, 2018

--

Top picks can be used to provide personalized recommendation to users in their homepage. The concept is similar to “Rabin’s amazon.com” in Amazon or “Recommended for you” in YouTube.

Let’s say we have to predict rating given by active user ‘a’ for a product ‘i’. Then the equation would be

Where,

Pa,i => Predicted rating for product ‘i’ by user ‘a’

bar(r) a => is the average rating of a user for any product

In collaborative filtering, we have a active user and his neighbouring users and their ratings for product ‘i’. And we can factor neighbours and their datas to predict the rating of active user. That is done by the big term in right side.

We loop over each users in the set of neighbours U.

r u,i => Rating of user ‘u’ to the product ‘i’

We don’t directly use the user’s rating but we adjust the rating by the mean rating given by the user for any product

bar(r) u => Mean rating of user ‘u’ for any product

Now let’s say you have N similar users then what you are doing according to above equation is that, you are talking the mean rating of active user and adjusting or moving the mean rating by how much the similar users have rated for that product.

Now the another term Wa,u is the similarity between active user ‘a’ and user ‘u’.

We can calculate the ratings for the products based on similar users and sort the products based on their rating to show top picks for the user. Nearest neighbour based methods are also known as Memory based methods because they involve in-memory calculation for finding similar users. It would require huge memory and it is also challenge for the scalability of model.

Item Based Collaborative Filtering

Collaborative filtering can also be item-based. We can also calculate the nearest neighbours for a product rather than user and discover similarity between them. Say we have to predict the ratings for a product by active user. Then we can find the nearest neighbours of that product, find the ratings of user for that products and find the weighted average of those ratings.

For example, if you have to predict the rating user would give for movie Gravity1 and the movies Gravity2 and Gravity3 are the neighbours of Gravity1. Then the weighted average of Gravity2 and Gravity3 is the rating of Gravity1.

Item based filtering is very popular and used in many big online stores like Amazon.

I will discuss more about recommendation systems 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