The Wayback Machine - https://web.archive.org/web/20240926203009/https://www.geeksforgeeks.org/ml-content-based-recommender-system/
Open In App

ML – Content Based Recommender System

Last Updated : 17 May, 2020
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

A Content-Based Recommender works by the data that we take from the user, either explicitly (rating) or implicitly (clicking on a link). By the data we create a user profile, which is then used to suggest to the user, as the user provides more input or take more actions on the recommendation, the engine becomes more accurate.

User Profile:
In the User Profile, we create vectors that describe the user’s preference. In the creation of a user profile, we use the utility matrix which describes the relationship between user and item. With this information, the best estimate we can make regarding which item user likes, is some aggregation of the profiles of those items.
Item Profile:
In Content-Based Recommender, we must build a profile for each item, which will represent the important characteristics of that item.
For example, if we make a movie as an item then its actors, director, release year and genre are the most significant features of the movie. We can also add its rating from the IMDB (Internet Movie Database) in the Item Profile.
Utility Matrix:
Utility Matrix signifies the user’s preference with certain items. In the data gathered from the user, we have to find some relation between the items which are liked by the user and those which are disliked, for this purpose we use the utility matrix. In it we assign a particular value to each user-item pair, this value is known as the degree of preference. Then we draw a matrix of a user with the respective items to identify their preference relationship.


Some of the columns are blank in the matrix that is because we don’t get the whole input from the user every time, and the goal of a recommendation system is not to fill all the columns but to recommend a movie to the user which he/she will prefer. Through this table, our recommender system won’t suggest Movie 3 to User 2, because in Movie 1 they have given approximately the same ratings, and in Movie 3 User 1 has given the low rating, so it is highly possible that User 2 also won’t like it.

Recommending Items to User Based on Content:

  • Method 1:
    We can use the cosine distance between the vectors of the item and the user to determine its preference to the user. For explaining this, let us consider an example:
    We observe that the vector for a user will have a positive number for actors that tend to appear in movies the user likes and negative numbers for actors user doesn’t like, Consider a movie with actors which user likes and only a few actors which user doesn’t like, then the cosine angle between the user’s and movie’s vectors will be a large positive fraction. Thus, the angle will be close to 0, therefore a small cosine distance between the vectors.
    It represents that the user tends to like the movie, if the cosine distance is large, then we tend to avoid the item from the recommendation.
  • Method 2:
    We can use a classification approach in the recommendation systems too, like we can use the Decision Tree for finding out whether a user wants to watch a movie or not, like at each level we can apply a certain condition to refine our recommendation. For example:



Similar Reads

Recommender System using Pyspark - Python
A recommender system is a type of information filtering system that provides personalized recommendations to users based on their preferences, interests, and past behaviors. Recommender systems come in a variety of forms, such as content-based, collaborative filtering, and hybrid systems. Content-based systems make recommendations for products base
5 min read
Recommender System using Bayesian Personalized Ranking
In the digital age, recommender systems have become pivotal in guiding user experiences on numerous platforms, from e-commerce and streaming services to social media. These systems analyze user preferences to suggest items that are most likely to be of interest. Among the various techniques used to power these systems, Bayesian Personalized Ranking
5 min read
Can I implement Recommender system using R Programming?
Yes, you can implement a recommender system using R programming. R provides several packages and tools specifically designed for building and evaluating recommender systems, such as recommenderlab, caret, and data.table. These packages make it possible to create various types of recommender systems, including collaborative filtering, content-based
2 min read
Python | Implementation of Movie Recommender System
Recommender System is a system that seeks to predict or filter preferences according to the user's choices. Recommender systems are utilized in a variety of areas including movies, music, news, books, research articles, search queries, social tags, and products in general. Recommender systems produce a list of recommendations in any of the two ways
3 min read
How Instagram Reel Uses Recommender Systems ?
Social media has become a major platform for communication and entertainment bringing a need to constantly seek innovative ways to keep users engaged and entertained. Instagram one of the leading social media platforms, has a key feature called Instagram Reels, a short-form video format designed to capture the attention of users and keep them scrol
10 min read
What are Recommender Systems?
There are so many choices that people often feel trapped, whether they're trying to choose a movie to watch, the right product to buy, or new music to listen to. To solve this problem, recommendation systems comes into play that help people find their way through all of these choices by giving them unique ideas based on their likes and dislikes. In
9 min read
Recommender Systems (Tweet Ranking) using TensorFlow
Recommender systems are important in many sectors because they assist consumers discover appropriate products or materials based on their preferences and behaviors. These systems analyze user-item interactions and create personalized suggestions using algorithms and approaches. In this post, we will look specifically at tweet ranking and how recomm
10 min read
Recommender Systems using KNN
Recommender systems are widely used in various applications, such as e-commerce, entertainment, and social media, to provide personalized recommendations to users. One common approach to building recommender systems is using the K-Nearest Neighbors (KNN) algorithm. This method leverages the similarity between users or items to generate recommendati
4 min read
Rule Based System Vs Machine Learning System
There are two main approaches in Artificial intelligence they are rule-based systems and machine-learning systems. Rule-based systems follow explicit rules created by human experts. They're like a set of instructions given to a computer that follows to make decisions. These systems are good for problems with clear rules and paths. On the other hand
8 min read
Clustering Based Algorithms in Recommendation System
Recommendation systems have become an essential tool in various industries, from e-commerce to streaming services, helping users discover products, movies, music, and more. Clustering-based algorithms are a powerful technique used to enhance these systems by grouping similar users or items, enabling more personalized and accurate recommendations. T
5 min read
NLP | Classifier-based Chunking | Set 2
Using the data from the treebank_chunk corpus let us evaluate the chunkers (prepared in the previous article). Code #1 : C/C++ Code # loading libraries from chunkers import ClassifierChunker from nltk.corpus import treebank_chunk train_data = treebank_chunk.chunked_sents()[:3000] test_data = treebank_chunk.chunked_sents()[3000:] # initializing chun
2 min read
Age of AI-based recruitment... What to expect?
The world is always heading towards a better future and artificial intelligence helps in making it simpler to achieve it. To improve the quality of professionals hired, organisations are constantly in search of better ways to hire and technology has proved to be a boon to identify the right candidates from a large pool of applicants. Just as the hi
3 min read
ML | Momentum-based Gradient Optimizer introduction
Gradient Descent is an optimization technique used in Machine Learning frameworks to train different models. The training process consists of an objective function (or the error function), which determines the error a Machine Learning model has on a given dataset. While training, the parameters of this algorithm are initialized to random values. As
5 min read
NLP | Training Tagger Based Chunker | Set 1
To train a chunker is an alternative to manually specifying regular expression (regex) chunk patterns. But manually training to specify the expression is a tedious task to do as it follows the hit and trial method to get the exact right patterns. So, existing corpus data can be used to train chunkers. In the codes below, we are using treebank_chunk
2 min read
NLP | Training Tagger Based Chunker | Set 2
Conll2000 corpus defines the chunks using IOB tags. It specifies where the chunk begins and ends, along with its types.A part-of-speech tagger can be trained on these IOB tags to further power a ChunkerI subclass.First using the chunked_sents() method of corpus, a tree is obtained and is then transformed to a format usable by a part-of-speech tagge
3 min read
NLP | Classifier-based Chunking | Set 1
The ClassifierBasedTagger class learns from the features, unlike most part-of-speech taggers. ClassifierChunker class can be created such that it can learn from both the words and part-of-speech tags, instead of just from the part-of-speech tags as the TagChunker class does. The (word, pos, iob) 3-tuples is converted into ((word, pos), iob) 2-tuple
2 min read
DBSCAN Clustering in ML | Density based clustering
Clustering analysis or simply Clustering is basically an Unsupervised learning method that divides the data points into a number of specific batches or groups, such that the data points in the same groups have similar properties and data points in different groups have different properties in some sense. It comprises many different methods based on
7 min read
R-CNN | Region Based CNNs
Since Convolution Neural Network (CNN) with a fully connected layer is not able to deal with the frequency of occurrence and multi objects. So, one way could be that we use a sliding window brute force search to select a region and apply the CNN model to that, but the problem with this approach is that the same object can be represented in an image
5 min read
ML | Case Based Reasoning (CBR) Classifier
As we know Nearest Neighbour classifiers stores training tuples as points in Euclidean space. But Case-Based Reasoning classifiers (CBR) use a database of problem solutions to solve new problems. It stores the tuples or cases for problem-solving as complex symbolic descriptions. How CBR works? When a new case arises to classify, a Case-based Reason
2 min read
Rule-Based Classifier - Machine Learning
Rule-based classifiers are just another type of classifier which makes the class decision depending by using various "if..else" rules. These rules are easily interpretable and thus these classifiers are generally used to generate descriptive models. The condition used with "if" is called the antecedent and the predicted class of each rule is called
4 min read
User-Based Collaborative Filtering
User-Based Collaborative Filtering is a technique used to predict the items that a user might like on the basis of ratings given to that item by other users who have similar taste with that of the target user. Many websites use collaborative filtering for building their recommendation system. Steps for User-Based Collaborative Filtering: Step 1: Fi
2 min read
Sentiments in Text - Word Based Encodings
Sentimental analysis is the processing of describing whether a particular feeling or an opinion is positive, negative, or neutral. For example, " I hate my Lunch", "I love my Lunch" and "I am fine with my Lunch".There is a negative, positive, and neutral tone in each of these sentences. On a large scale, Sentimental Analysis is used in determining
2 min read
Instance-based learning
The Machine Learning systems which are categorized as instance-based learning are the systems that learn the training examples by heart and then generalizes to new instances based on some similarity measure. It is called instance-based because it builds the hypotheses from the training instances. It is also known as memory-based learning or lazy-le
2 min read
Introduction to Speech Separation Based On Fast ICA
Prerequisite: ML | Independent Component Analysis What is Speech Separation? Speech Separation is the process of extracting all overlapping speech sources from a given mixed speech signal. Speech Separation is a special scenario for source separation problems, where the focus is only on overlapping speech signal sources. Speech Separation is implem
3 min read
Emotion Based Music Player - Python Project
In this article, we will be discussing how can we recommend music based on expressions or say dominant expressions on someone's face. This is a basic project in which we will be using OpenCV, Matplotlib, DeepFace, and Spotify API. Import Packages and ModulesOpenCV: OpenCV is a Python open-source package used for computer vision, machine learning, a
6 min read
Region and Edge Based Segmentation
Segmentation Segmentation is the separation of one or more regions or objects in an image based on a discontinuity or a similarity criterion. A region in an image can be defined by its border (edge) or its interior, and the two representations are equal. There are prominently three methods of performing segmentation: Pixel Based SegmentationRegion-
4 min read
Implementation of Teaching Learning Based Optimization
The previous article Teaching Learning Based Optimization (TLBO) talked about the inspiration of teaching learning-based optimization, it's mathematical modeling and algorithms. In this article we will implement Teaching learning-based optimization (TLBO) for two fitness functions 1) Rastrigin function 2) Sphere function. The algorithm will run for
7 min read
Propositional Logic based Agent
Prerequisite: Wumpus World in Artificial Intelligence In this article, we'll use our understanding to make wumpus world agents that use propositional logic. The first stage is to enable the agent to deduce the state of the world from its percept history to the greatest extent possible. This necessitates the creation of a thorough logical model of t
8 min read
Dictionary Based Tokenization in NLP
Natural Language Processing (NLP) is a subfield of artificial intelligence that aims to enable computers to process, understand, and generate human language. One of the critical tasks in NLP is tokenization, which is the process of splitting text into smaller meaningful units, known as tokens. Dictionary-based tokenization is a common method used i
5 min read
Rule-Based Tokenization in NLP
Natural Language Processing (NLP) is a subfield of artificial intelligence that aims to enable computers to process, understand, and generate human language. One of the critical tasks in NLP is tokenization, which is the process of splitting text into smaller meaningful units, known as tokens. Dictionary-based tokenization is a common method used i
4 min read
Practice Tags :