Did Amazon just recommend you the item, you wanted to Buy?

Lokesh Rathi
Analytics Vidhya
Published in
4 min readJul 16, 2020

--

Ever wondered how does Netflix/Amazon recommend you Movies /Products to buy? And well, almost all the time they get your interest displayed.

Recommendation System

Welcome!! In this article, we will dive deep into the most fascinating topics, that we unknowingly encounter everyday.

Source: Google

Recommendation algorithms are best known for their use on e-commerce Web sites, where they use input about customer’s interests to generate a list of recommended items.

At Amazon.com, the recommendation algorithm is used to personalize the online store for each customer. The store radically changes based on the customers interest. Books for avid readers, baby products for mothers, you get the point.

So how does a Recommendation System work?

Well, prior to that, let us know that there are 2 major approaches for solving a Recommendation problem.

  1. Traditional Collaborative filtering.
  2. Search- based methods.

Well actually Amazon uses something known as Item-to-Item collaborative filtering, which we will discuss in some time. Lets first understand the above mentioned approaches.

Traditional Collaborative Filtering:

This approach initially identifies similar users based on preferences. This can be achieved via this formula:

Image source: Google

In the second step, the algorithm generates recommendations based on the ratings of a few customers who are most similar to the user.

This algorithm can select recommendations from similar customers items using various methods as well, a common technique is to rank each item according to how many similar customers purchased it.

Drawbacks:

Using this method is computationally expensive. Here the worst case scenario tends to be O(MN), ‘M’ is the number of customers and ‘N’ is the number of products catalog items. Although we can use Dimensionality reduction such as Clustering or Principal Component Analysis(PCA) to reduce this, they also tend to reduce the recommendation quality in several ways.
Another major drawback, is that the user preference tend to change with time.

Search- Based Methods

Search or Content-based methods treats the recommendation problem as search for related items. Given the users purchased and rated items, the algorithm conducts a search query to find out other popular item by the same author, artist. If the user has few purchases or ratings, search based algorithm scale and perform well

Drawbacks:

What if the user has thousands of purchases, it becomes impractical to base a query on all of them. The algorithm is forced to used a subset of Data, which finally degrades the quality of the model. In these cases, the recommendations are either very general or too narrow.

Finally, the one used by Amazon.com

Amazon.com extensively uses recommendation algorithms to personalize its Website to each customer’s interest. Because the above mentioned algorithms, cannot scale the tens of millions of customers and products, Amazon developed something known as Item-to-Item collaborative filtering.

Clicking on the ‘Recommendation for you’, opens up area where they can filer their recommendation by product line and subject area.

Amazon.com

Working:

Rather than simply matching users to similar users, this method matches each of the user’s purchased and rated items, then combines those similar items into a recommendation list.

To determine the most-similar match for a given item, the algorithm builds a similar-items tables by finding items, the customer tends to purchase together. Given a similar-item table, the algorithm finds items similar to each of the user’s purchases and ratings and aggregates those items and then recommends the most popular or correlated items. This computation is very quick, depending only on the number of items the user purchased or rated.

The key to this method is that similar items table is created offline. The algorithms online component- looking up similar item for the user’s purchases and ratings — scales independently of the total number of customers. It depends solely on how many titles the user has purchased.

I hope I was able to provide you small glimpse of how we are Recommended items in our Digital life.

You can follow me on LinkedIn and GitHub for more such interesting topics.

--

--

Lokesh Rathi
Analytics Vidhya

I write articles on Data Science, Machine learning Algorithm and Big Data.