Recommendation System

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Click to edit Master title style

Types of
Recommendation
Systems
1
Click
Theretoare
edit Master
mainly titletypes
three style of Recommendation Systems

1. Content-based filtering

2. Collaborative filtering

3. Hybrid recommendations

2 2
Click to edit
Pictorial Master title style
descriptions

3 3
Click to edit
Numerical Master title
examples style
of Content-based filtering

Example 1:A dataset is given in the following table-


Movie Genre Duration Rating

A Action 120 minutes 4.5

B Comedy 90 minutes 3.8

C Action 110 minutes 4.0


A user likes movie A. We can now calculate a similarity
score between
D the user’s
Drama liked movies and each remaining
150 minutes 4.2 ones
based on the features. Let’s use simple weighted sum approach to
assign weights to each feature and calculate the similarity score.

4 4
Weights(arbitrary):

Click to edit Master title style


1.Genre weight: 0.6
2.Duration weight: 0.3
3.Rating weight: 0.1
Similarity score (S) between the user’s preference and a movie (X) is calculated as follows:
S(X)=Genre weight×Genre similarity(X)+Duration weight×Duration similarity(X)+ Rating weight×Rating
similarity(X)
Now, let's calculate the similarity scores(for genre Jaccard similarity, for duration and rating Percentage
similarity) for the remaining movies:
1.Movie B: S(B)=0.6×0+0.3×[1-(30/60)]+0.1×[1-(0.7/0.7)]
S(B)=0.15
2.Movie C: S(C)=0.6×1+0.3×[1-(10/60)]+0.1×[1-(0.5/0.7)]
S(C)=0.878
3.Movie D:S(D)=0.6×0+0.3×[1-(30/60)]+0.1×[1-(0.3/0.7)]
S(D)=0.207
Now, based on the similarity scores ,we can recommend Movie C to the user,
As it has the highest similarity score. 5 5
Click to edit Master title style

Formulas for Jaccard and Percentage similarity-


Jaccard similarity=(size of intersection/size of union)
Percentage similarity=[1-(absolute difference between
the two data/maximum possible difference in the
given dataset)]

6 6
Click to edit Master title style

Example 2:A dataset is given in the following table-


Product Feature 1 Feature 2 Feature 3 Feature 4
weight weight weight weight
Product 1 1 1 2
Product 2 1 4
Product 3 3 1
User Interest 2 1 1

User Interest Level = ∑piui (i=1 to 4)


Where pi is the product feature weight and ui is user interest value in
column i

7 7
Click to edit Master title style

User Interest Level for Product 1


= 2x1 + 0x0 + 1x1 + 1x2 = 5
User Interest Level for Product 2 = 2x0 + 0x1 + 1x4 + 1x0 = 4

User Interest Level for Product 3 = 2x3 + 0x0 + 1x0 + 1x1 = 7

The user’s interest level in product 3 is maximum, therefore the


system will recommend product 3 to the user.

8 8
Click to edit
Numerical Master title
example style
of Collaborative filtering

Movies Doctor Harry Harry Twilig The Iron Little Row


Users Strange Potter 2 Potter ht Notebo Man 2 Wome mean
3 ok n
A 4 5 1 10/3
Example
B 5
1: A dataset
5
is given the following table-
4 14/3

C 2 4 5 11/3

D 3 3 6/3

9 9
Click
Using to edit Master
Centered title style
cosine,
Ratings are normalized by subtracting row
Strange Potter mean-
Doctor Harry Harry Twilig The Iron Little
Movies 2 Potter ht Notebo Man 2 Women
Users 3 ok
A Here 2/3 the user’s ratings 5/3 -7/3are centered
B
around
1/3
zero.
1/3
The
-2/3
missing ratings are
treated
C
D
as Zero 0
also. Positive rating0 means
-5/3 1/3 4/3

the user likes the movie more than average


and negative rating means the user likes
the movie less than average.
1010
Click to edit Master title style

Sim(A,B) = cos(rA,rB) =( rA.rB) /(|| rA ||.|| rB ||) = 0.09


Similarly sim(B,C) = 0
Now the prediction for user B to rate the movie Twilight
Will be [sim(A,B)*rating(Twilight)A
+sim(B,C)*rating(Twilight)C]/[sim(A,B)+sim(B,C)] =5/3

1111
Numerical
Click to editexample of Hybrid
Master title style
recommendation
Example 1: Hybrid job recommendation system using the following dataset-

we have a collaborative filtering model


that predicts
Job1 user preferences
Job2 Job3 Job4 Job5based
Row on
mean
their
User1 historical
5 2 interactions
- 3 with
- jobs-
10/3
User2 - 3 4 - 4 11/3
User3 4 - 5 5 - 14/3
User4 - 5 - - 4 9/3

1212
Click to edit Master title style

Ratings are normalized by subtracting row mean-


Job1 Job2 Job3 Job4 Job5
User1 5/3 -4/3 - -1/3 -
To calculate
User2 - -2/3 collaborative
1/3 - filtering
1/3 score
for User1
User3
User4
and
-2/3
-
Job3,
2
- 1/3
-
1/3
-
-
-1
Sim(User1, User2)= 0.5,sim(User1,User3)=-
0.7,

Rating(User2,Job3)=4,rating(User3,Job3)=5
CF_Score(User1,Job3)=[(0.5x4)+(0.7x5) ]/
(0.5+0.7)=4.58 1313
•We'll
Clickuseto
theedit
content-based filtering
Master title example from the job
style
recommendations with user1’s profile and weights for skills, industry, and
location:
•Given: Skills Industry Location
•User1's Skills: {Programming}User1 0.8 0.1 0.1
•Job3's Skills: {Programming, Machine Learning}
•User1’s industry preference:{Technology}
•Job3’s industry={Technology}
•User1’s location preference:{California, Tokyo, Texas, Seoul}
•Job3 location:{California}
Now skill-similarity(User1,Job3)=1/2=0.5
industry-similarity(User1,Job3)=1/1=1
location-similarity(User1,Job3)=1/4=0.25 Therefore,
CB_Score(User1,Job3)=0.8x0.5 + 0.1x1 + 0.1x0.25 =0.525
1414
Click
HybridtoRecommendation:
edit Master title style

A weighted sum approach is used to combine the collaborative filtering and content-based filtering scores.
Assuming CF_Weight is 0.7 and CB_Weight is 0.3.
The hybrid scores for User1 and Job3 is calculated below-
Collaborative Filtering Score (CF_Score(User1, Job3)): 4.58
Content-Based Filtering Score (CB_Score(User1, Job3)): 0.525
Hybrid score(User1, Job3) = 0.7x4.58 + 0.3x0.525 = 3.36
Therefore, the hybrid recommendation system suggests that User1 might like Job3 with a
hybrid score of 3.36. This combines collaborative and content-based filtering to provide a
more personalized job recommendation. Similar calculations can be done for other users and
jobs in the recommendation system, and the weights can be adjusted between collaborative
and content-based recommendations by random search and different machine learning
1515
techniques.
Click to edit Master title style

End of Slides

16

You might also like