You are on page 1of 32

RECOMMENDATION SYSTEM

MUFADDAL CHALLAWALA
ENROLLMENT NO.:12202050403008
OUTLINE

• Introduction
• Recommendation system
• Types of recommendation systems
• Collaborative filtering system
• User based collaborative filtering
• Item based collaborative filtering
• Advantages and disadvantages of collaborative filtering
Continue…

• About IBCF
• Algorithm for IBCF
• Item similarity computation
• Calculate Recommendation Scoring
INTRODUCTION

• Recommender systems use artificial intelligence (AI) methods to provide users with item
recommendations.
• It is used to help users find new items or services, such as books, music, transportation or
even people, based on information about the user, or the recommended item.
• These systems also play an important role in decision-making, helping users to maximize
profits or minimize risks.
• Today, recommendation systems are used in many information-based companies such as,

Google
Netflix
Twitter
LinkedIn
And many other companies.
RECOMMENDATION SYSTEM

Definitions:
• Recommender system is defined as a decision making strategy for users under complex
information environments.
• Recommender system was defined from the perspective of E-commerce as a tool that helps
users search through records of knowledge which is related to users’ interest and preference.
• Recommender system was defined as a means of assisting and augmenting the social process
of using recommendations of others to make choices when there is no sufficient personal
knowledge or experience of the alternatives.
RECOMMENDATION SYSTEM
• Recommender system has the ability to predict whether a particular user would prefer an
item or not based on the user’s profile.
• Recommender systems are information filtering systems that deal with the problem of
information overload by filtering vital information fragment out of large amount of
dynamically generated information according to user’s preferences, interest, or observed
behavior about item.
• ML algorithms are being used in RSs to provide users with better recommendations.
However, the ML field does not have a clear classification scheme for its algorithms, mainly
because of the number of approaches and the variations proposed in the literature.
• As a consequence, it becomes difficult and confusing to choose an ML algorithm that fits
one’s need when developing an RS
TYPES OF RECOMMENDATION SYSTEM

• There are mainly 3 types of recommendation systems:


1. Collaborative filtering
2. Content – based filtering
3. Hybrid filtering
• There are also other techniques:
1. Stereotyping
2. Graph based
3. Co-occurrence recommendations
4. Global relevance
COLLABORATIVE FILTERING

• The term “collaborative filtering” was coined in 1992 by Goldberg et al.


• Their theory was that users like what like-minded users like, where two users were
considered like-minded when they rated items alike.
• When like-minded users were identified, items that one user rated positively were
recommended to the other user, and vice versa.
• Recommendations are not based on item similarity but on user similarity.
Continue….
• Collaborative filtering technique works by building a database of preferences for items by
users.
• It then matches users with relevant interest and preferences by calculating similarities
between their profiles to make recommendation.
• Such users build a group called neighborhood.
• An user gets recommendations to those items that he has not rated before but that were
already positively rated by users in his neighborhood.
Collaborative filtering
• Example:
Recommendation systems using a
collaborative approach consider the user
data when processing information for
recommendation.
For instance, by accessing user profiles in
an online book store, the Recommendation
system has access to all the user data, such
as the age, country, city, and books
purchased. With this information, the
system can identify users that share the
same author preference, and then suggest
books bought by similar users.
TYPES OF COLLABORATING FILTERING
USER BASED COLLABORATIVE FILTERING
• User based filtering is based on the notion of users’
similarity.
Example:
• You can see a picture where 3 children named A, B, C,
and 4 fruits, grapes, strawberry, watermelon, and orange
respectively.
• Based on the image let assume A purchased all 4 fruits,
B purchased only strawberry and C purchased
strawberry as well as watermelon.
• Here A & C are similar kinds of users because of this C
will be recommended Grapes and Orange as shown in
dotted line.
ITEM BASED COLLABORATIVE FILTERING
• It is based on the notion of item similarity.
Example:
• Here the only difference is that we see
similar items, not similar users like if you
see grapes and watermelon you will realize
that watermelon is purchased by all of them
but grapes are purchased by Children A & B.
• Hence Children C is being recommended
grapes.
ADVANTAGES AND DISADVANTAGES

Advantages:
• It works well on big as well as small data.
• This model helps the users to discover a new interest in a given item but the model might
still recommend it because similar users are interested in that item.
• No need for Domain Knowledge.
Disadvantages:
• It cannot handle new items because the model doesn’t get trained on the newly added items
in the database. This problem is known as Cold Start Problem.
• Side Feature Doesn’t have much importance.
ABOUT IBCF
• Recommendation system have been around for quite
some time now and it helps to show relevant items to
user.
• One such technique to recommend item to user is
ITEM BASED RECOMMANDATION SYSTEM also
known as item-item collaborative filtering or IBCF.
• Item-item collaborative filtering is kind of
recommendation method which looks for similar items
based on the items users have liked or positively
interacted with.
• It was developed by the amazon in 1998 and plays the
great role in success of amazon.
ALGORITHM FOR IBCF
• The item-item collaborative filtering algorithm have 2 steps to predict the item to
recommend to the user:

1. Item similarity computation 2. Prediction computation


ITEM SIMILARITY COMPUTATION
User 1:Toy Story 2:Star Wars 3:Iron man 4:The
Batman
• Suppose we have a table of
1 3 3 users and their ratings for
2 5 5 4 movies.
• Let’s pick two movies for
3 3 5 3
which we have to calculate
4 2 the similarity, how much
5 4 3 4 3 these two movies are
6 3 5 comparable to one another
in terms of there likeness
7 2 2 4 4 by users.
8 4 5
9 3 5
10 4 4 5
User 1:Iron man 2:The Product of Movie
Batman Ratings
1 0
2 5 4 20
3 5 0

• First multiple ratings of both the 4 0


movies with each other and the 5 4 3 12
sum the result. Let’s call this 6 5 0
value ‘A’. 7 4 4 16
8 4 5 20
9 0
10 4 5 20
A=88(sum of product of
ratings
User 1:Iron 2:The Product of Square of Movie Square of
man Batman Movie Ratings 1 Movie 2

1 0 0 0
• Second, square the ratings of
2 5 4 20 25 16
movie 1 and movie 2 and sum
3 5 0 25 0
them and then take the square
4 0 0 0
5 4 3 12 16 9
root of the both sum values.
6 5 0 0 25 • After that multiply the square
7 4 4 16 16 16 root value of movie 1 and
8 4 5 20 16 25 movie 2.
9 0 0 0
10 4 5 20 16 25
• We call this final value ‘B’.

A=88 (sum of B=114.9956521 (product of values


product of from square root of sum of values
ratings) from square of ratings)
User 1:Iro 2:The Product of Square of Square of
n Batman Movie Movie 1 Movie 2
man Ratings
1 0 0 0
2 5 4 20 25 16
3 5 0 25 0
• Third, divide A and B, this will gets
4 0 0 0
us a score that indicates how close
5 4 3 12 16 9
movie 1 and movie 2 are to one 6 5 0 0 25
another. 7 4 4 16 16 16

• Repeating the above process for all 8 4 5 20 16 25


9 0 0 0
the movies will result in a table
10 4 5 20 16 25
with similarities between each
movie. A=88 (sum B=114.9956521 (product of A/B=0.7652
of product values from square root of sum (similarity
of ratings) of values from square of ratings) between
movie 1 and
2)
• Here is how the above process is depicted in mathematical form.

This equation is called cosine similarity equation.


• Let’s break it down piece by piece to understand what all these weird symbols mean.
 Label 1 illustrates the main item i for which we have to find a similar item.
 Label 2 illustrates the item being compared with item i.
 Label 3 and 4 illustrate rating for item i and item j given by user u.
 Label 5 represent the repetition of the multiplication for all users.
 Label 6 indicates sum of the result of multiplication of the rating provided by the user.
 The other symbols indicates the square root of sum of squared ratings for item i and item j
and their multiplication .
• This method is also known as cosine similarity. It helps to calculate how close two vectors
are to one another.
• Cosine similarity works but it doesn’t take into account the optimistic behavior of users.
• Different users can rate the same item differently depending upon how optimistic they are.
• On the scale of 5, one could rate an item 5 while another could rate 3 even though they both
very much liked the item.
• To account for this we have to make a small change to our similarity formula.
• Subtracting user rating of a given item with that user’s average rating normalizes ratings to
the same scale and helps overcome optimism issues. We call it adjusted cosine similarity.
• There is also a similar method where instead of subtracting with the user’s average rating we
subtract with items average rating.
• This helps to understand how much given user ratings deviate from average item rating. This
technique is known as Pearson similarity.
• Both Cosine and Pearson are widely used methods to compute similarities.

Pearson’s Similarity Correlation


• Applying cosine similarity equation on ratings for items will produce a table or matrix that’ll
show how similar one item is to another.

Iron man The Batman Toy Story Star Wars

Iron man 1 0.7652 0.5114 0.5801

The Batman 0.7652 1 0.3632 0.7901

Toy Story 0.5114 0.3632 1 0.5687

Star Wars 0.5801 0.7901 0.5687 1


CALCULATE RECOMMENDATION SCORING

• We know which items are comparable but we have yet to know which items to recommend
to users from the list of similar items.
• For this will have to combine our similarity matrix with users' past history of rated items to
generate a recommendation.
• For this we have an equation :
• This equation shows that in order to calculate recommendation score of an item ‘i’ for a user
‘u’ sum the multiplication of an item ‘i’ and ‘j’ similarity with the difference of rating given
by user ‘u’ to an item ‘j’ and the average rating of an item ‘j’.
• Divide the result with the sum of item ‘i’ and ‘j’s similarity, add the output with the user ‘u’s
average rating.
• Doing so will generate a matrix of scores for users and available items. Top scored items can
be recommended to the user.
User 1:Toy Story 2:Star Wars 3:Iron man 4:The
Batman
1 -1 -1 1.87966 2.16432
2 2.6666666 -1 -1 -1
7
3 -1 2.34362743 -1 -1
4 -1 2.6743534 2.89016 2.34542
5 -1 -1 -1 -1
6 1.1324 -1 2.39308 -1
7 -1 -1 -1 -1
8 0.988734 1.16543 -1 -1
9 -1 -1 0.81435 2.56896
10 1.136523 -1 -1 -1
Recommendation score matrix for users
Equation
REFERENCES

1. www.analyticsvidhya.com/blog/2021/07/recommendation-system-understanding-the-basic-c
oncepts
by Shubham Kumar Agrawal — Published On July 13, 2021.
2. Cairo University, Egyptian Informatics Journal (2015).
3. The Use of Machine Learning Algorithms in Recommender Systems: A Systematic Review.
4. Erschienen in: International Journal on Digital Libraries ; 17 (2016), 4. - S. 305-338
Research-paper recommender systems: a literature survey.
5. Guide to item based collaborative filtering by mufaddal qutbuddin – Published on March 7,
2020.

You might also like