Recommendation System For Daily Life.

Simple explanations of recommendation systems-Beginners Guide



During the last few years, the demand for machine learning increases rapidly. Covid pandemics increase the intensity of this demand. with the ascent of Youtube, Amazon, Netflix, and numerous other such web administrations, recommender frameworks have assumed increasingly more position in our lives. Recommender frameworks are today unavoidable in our every day online excursions. The main aim of this system is to suggest relevant items to users.

In this article, we will experience various standards of recommender frameworks. In the first segment, we are going to review the two significant ideal models of recommender frameworks: collaborative and content-based techniques. Then we discuss various methods in collaborative filterings such as user-based and item-based. The accompanying segment will be devoted to content-based techniques and how they work. At last, we will talk about TFIDF vectorizer.

1.Collaborative Filtering method

This method is working on the basis of past interactions between users and items in order to produce new recommendations; that is, this method can recommend an item to user A based on the interest of similar user B.


To implement this method we have a dataset contains a set of items and a set of users who have reacted to some of the items. Before jump into it further, we have to understand two terms: Implicit and explicit rating. In explicit rating, the users rate a document on a pre-defined scale but in the case of implicit, the rating is not directly provided we have to assign it by considering other fields given(viewing an item, adding it to a wish list, the time spent on an article).

Two approaches in collaborative Filtering: User-based and Item-based

User-Based collaborative Filtering

Suppose that we want to recommend a news article to our friend Aleena. We could assume that similar individuals will have a similar taste. Suppose that I and Aleena have read similar articles, and we rated them all almost equally. But Aleena hasn’t read one of the articles that I read. If I love that article, it sounds logical to imagine that she will as well. With that, we have created a rating based on our similarity.


A particular application of this is the user-based Nearest Neighbor calculation. This calculation needs two tasks:

  1. find the distance between each k neighbors of the user using the similarity function. Commonly used similarity measures are cosine, Pearson, Euclidean, etc. Given below the cosine similarity:

2.Then we are creating a User-Item Matrix, predicting the ratings on items the active user has not read, based on the other similar users.

Item-Based collaborative Filtering

Using the previous example we can define it as instead of focusing on similar users we could focus on similar items. Here we find the similarity of items and predict the rating for user-item pairs using this similarity. Like user based here also similarity can find using the different similarity measures.

We could divide item-based into two subtasks:

  1. Find the similarity of items using similarity measures:

a.cosine similarity

b.correlation-Based Similarity

c.1-Jaccard distance

2.calculation of prediction

a.weighted sum


2.Content-Based Filtering

This method uses features of the item and recommends other items similar to what the user likes. For generating user profiles it uses explicit and implicit feedback, which is then used for recommendation. The model should recommend items relevant to the user.


The content-based system doesn’t need other user’s information during recommendation to one user.

Term Frequency (TF) and Inverse Document Frequency (IDF)

The concepts of Term Frequency (TF) and Inverse Document Frequency (IDF) are used in content-based recommender. TF is the Term frequency of the document and IDF is the inverse of the document frequencies among the whole corpus of documents.TF-IDF gives more importance to less frequent words in the corpus. Using the result obtained from Term frequency and Inverse document frequency it assigns a weight to each term or word in the document.

TF-IDF value is high when the word appears more number of times in a document and fewer times in other documents. This method didn’t consider the semantic and syntactic similarity of words with other words.


I tried to explain the idea behind the recommendation system and the methods we have to understand before building a recommendation system. Also, I introduced different approaches to this recommendation system with real scenarios.

passionate about data science and machine learning.