Almost every regular internet user has now become accustomed to personalized recommendations. Everyone is familiar with Recommender Systems on ecommerce websites like Amazon, Flipkart but there are also some more sophisticated systems in space. Netflix suggests videos to watch. TiVo records programs on its own, just in case we’re interested. Pandora builds personalized music streams by predicting what song user is interested in listening. All these enterprises use Recommender Systems to enhance customer experience whenever a user uses their service.
Recommender systems are based on computer algorithms which help customers by selecting products they might like and then might buy based on their browsing, searches, purchases and preferences.
Over the years Recommender Systems have evolved considerably. Different companies use different approaches in building their Recommender Systems. But the two basic algorithms over which most systems are developed for personalized recommendations are:-
- User-User Collaborative Filtering
- Item-Item Collaborative Filtering
User-User Collaborative Filtering involves determining customers which have similar tastes, purchases and preference as customer whom recommendation is being made. In simple terms if there is something that people which have similar taste as me like, it would be recommended to me.
Item-Item Collaborative Filtering involves determining items which are similar to the item which customer has browsed over or purchased. Let us say I bought an iPhone then recommender could suggest me iPad or similar phones in that price range.
Let us create a basic user-user Movie Recommender System with R.
You can download the data from- A1Ratings.csv
train=read.csv('A1Ratings.csv') train[is.na(train)]<-0 user_id<- train[,1] train=train[,2:ncol(train)] train=t(train)
This is a user-user similarity matrix
similarity<- t(train) %*% as.matrix(train)
This will give us the likelihood matrix. Here every cell gives the likelihood estimation of how much user would like that movie.
recommendar<- similarity %*% t(train) recommendar<- data.frame(user_id,recommendar)
Now system should recommend those movies to the user which he hasn’t seen yet. Hence to every user system will recommend those movies which have high likelihood and have not yet been watched by the user.
index<- train==0 index=t(index) user=1 suggest<- recommendar[user,][index[user,]] suggest=suggest[order(suggest, decreasing = TRUE)] suggest
## X2762..Sixth.Sense..The..1999. X2396..Shakespeare.in.Love..1998. ## 1 3344 2808 ## X2028..Saving.Private.Ryan..1998. X541..Blade.Runner..1982. ## 1 2655 2471 ## X356..Forrest.Gump..1994. ## 1 2423
You can create a system using Item-Item collaborative filtering as well by creating an item-item similarity matrix with slight modifications in the code. Similarity matrix is the core concept of a Recommender System. There are some more sophisticated means of creating a similarity matrix using cosine similarity or log likelihood.
It has now become imperative for companies to incorporate Recommender Systems to their service to boost their sales and profits. With increasing data, performance of recommender system also increases and more information about the customer’s needs can then be inferred. To know more on how Recommender Systems have evolved, drawbacks of UUCF and IICF, and some more concepts on Recommender Systems click here.