Recommendation System
Ever wondered, “what algorithm google uses to maximize its target ads revenue?”. What about the e-commerce websites which advocates you through options such as ‘people who bought this also bought this’. Or “How does Facebook automatically suggest us to tag friends in pictures”?

Companies nowadays are building smart and intelligent recommendation engines by studying the past behavior of their users. Hence providing them recommendations and choices of their interest in terms of “Relevant Job postings”, “Movies of Interest”, “Suggested Videos”, “Facebook friends that you may know” and “People who bought this also bought this” etc.
What are Recommendation Engines ?
Often termed as Recommender Systems, they are simple algorithms which aim to provide the most relevant and accurate items to the user by filtering useful stuff from of a huge pool of information base. Recommendation engines discovers data patterns in the data set by learning consumers choices and produces the outcomes that co-relates to their needs and interests.

Types of Recommendation Engine:
In this article, we will explain two types of recommendation algorithms that are also used by most of the tech giants like Google and Facebook in their advanced recommender system modules.
As a typical business problem,
Consider a scenario of an e-commerce website which sells thousands of smartphones. With growing number of customers every day, the task in hand is to showcase the best choices of smartphones to the users according to their tastes and preferences.
To understand how recommendation engine works, let’s slice the data into a sample set of five smartphones with two major features “Battery and Display”. The five smartphones have following properties:
- S1 has good battery life but poor display
- S2 has an amazing battery performance but very rough display
- S3’s battery is one of the best but display lacks quality
- S4 & S5 are good in terms of display but poor in terms of battery performance.
Using these characteristics, we can create an Item — Feature Matrix. Value in the cell represents the rating of the smartphone feature out of 1.

Our sample set also consist of four active users with their preferences.
- Aman: He prefers battery over display as an ideal smartphone feature.
- Bob: He likes a long lasting battery.
- Chandan: For Chandan, display should be decent, battery should be normal.
- David: For David, Display is extremely important but not the battery.
Using their interests, we can create a User — Feature Matrix as follows:

We have two matrices: Item — Feature and User — Feature. We can create the recommendation of smartphones for our users using following algorithm:
Content Based Recommendations
Content based systems, recommends item based on a similarity comparison between the content of the items and a user’s profile. The feature of items are mapped with feature of users in order to obtain user — item similarity. The top matched pairs are given as recommendations, as demonstrated below. Feature vector is a simple array of features of that item.
Representing every user by a feature vector:

Also, every item representation as a feature vector:

and so on…
Content Based Item — User Mapping Recommendations are given by the equation:
MAX ( U(j)T . I(i) )
i,j -> n,mFor User U1 (Aman), Smartphone recommendation is:
MAX( U1TS1, U1TS2, U1TS3, U1TS4, U1TS5MAX([0.9 0.1]T [0.9 0.1], [0.9 0.1]T [1 0], [0.9 0.1]T [0.99 0.01], [0.9 0.1]T [0.1 0.9], [0.9 0.1]T [0.01 0.99])MAX(0.82 , 0.9 , 0.89 , 0.18 , 0.10)= S2(0.9), S3(0.89) & S1(0.82)
Smartphones S2, S3 and S1 has the highest recommendation scores, Hence S2, S3 and S1 are recommended to Aman.
One more technique could be used for recommender systems. This technique is known as Collaborative Filtering. Try reading about it on your own and understand the basic principle underlying.
There also exists more advanced techniques like ALS : Alternating Least Square Recommendations and Hybrid Recommendation Engines. The Recommendation Engines have become an important need with the growing information space.
End notes
I think this was pretty intuitive and clear and gives you a feel about what the algorithm is actually doing. I also feel that till now you have started developing interest hopefully. If not, just start thinking about the applications of recommendation systems in real life and I am sure that you will certainly gain interest in it. ;)
