0% found this document useful (0 votes)
39 views17 pages

Week 6 Recommender

Uploaded by

Ammar Mousa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views17 pages

Week 6 Recommender

Uploaded by

Ammar Mousa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Lectures 6

SNA
Social Networks Analysis

Prepared by:
Dr.Nesma Ebrahim
ORCID: orcid.org/0000-0001-6677-2837
Web of Science Researcher
Google Scholar Citation: Nesma Ebrahim Elsayd
Assistant Professor , Computer Science

1
2- Collaborative Filtering Recommender System
Collaborative Filtering

• Consider user x

• Find set N of other


users whose ratings
are “similar” to x
x’s ratings

• Estimate x’s ratings


based on ratings N
of users in N
Collaborative Filtering

Collaborative filtering: the process of selecting


information or patterns using techniques involving
collaboration among multiple agents, viewpoints,
data sources, etc.

Advantage: we don’t need to have additional


information about the users or content of the items
– Users’ rating or purchase history is the only information
that is needed to work

44
Rating Matrix: An Example

55
Rating Matrix

Users rate (rank) items (purchased, watched)

Explicit ratings:
– entered by a user directly
– i.e., “Please rate this on a scale of 1-5”

Implicit ratings:
– Inferred from other user behavior
– E.g., Play lists or music listened to, for a music Rec system
– The amount of time users spent on a webpage

66
Memory-Based Collaborative Filtering

Two memory-based methods:

User-based CF
Users with similar previous
ratings for items are likely to rate
future items similarly

Item-based CF
Items that have received similar
ratings previously from users are
likely to receive similar ratings
from future users

77
Collaborative Filtering: Algorithm

1. Weigh all users/items with respect to their


similarity with the current user/item

2. Select a subset of the users/items (neighbors) as


recommenders

3. Predict the rating of the user for specific items


using neighbors’ ratings for the same (or similar)
items

4. Recommend items with the highest predicted rank

88
Finding “Similar” Users

representation as sets:
Rx = {1, 4, 5}
Ry = {1, 3, 4}
User-based nearest-neighbor
collaborative filtering (1)
 The basic technique:
 Given an "active user" (Alice) and an item I not yet seen by
Alice
 The goal is to estimate Alice's rating for this item, e.g., by
 find a set of users (peers) who liked the same items as Alice in the
past and who have rated item I
 use, e.g. the average of their ratings to predict, if Alice will like item I
 do this for all items Alice has not seen and recommend the best-rated
Item1 Item2 Item3 Item4 Item5
Alice 5 3 4 4 ?
User1 3 1 2 3 3
User2 4 3 4 3 5
User3 3 3 1 5 4
User4 1 5 5 2 1
User-based nearest-neighbor
collaborative filtering (2)
 Some first questions
 How do we measure similarity?
 How many neighbors should we consider?
 How do we generate a prediction from the neighbors' ratings?

Item1 Item2 Item3 Item4 Item5


Alice 5 3 4 4 ?
User1 3 1 2 3 3
User2 4 3 4 3 5
User3 3 3 1 5 4
User4 1 5 5 2 1
Measuring user similarity
 A popular similarity measure in user-based CF: Pearson correlation

a, b : users
ra,p : rating of user a for item p
P : set of items, rated both by a and b
Possible similarity values between -1 and 1; = user's average ratings

Item1 Item2 Item3 Item4 Item5


Alice 5 3 4 4 ? sim = 0,85
User1 3 1 2 3 3 sim = 0,70
sim = -0,79
User2 4 3 4 3 5
User3 3 3 1 5 4
User4 1 5 5 2 1
Pearson correlation

 A popular similarity measure in user-based CF: Pearson


correlation

The Pearson correlation measures the strength of the linear


relationship between two variables. It has a value between
-1 to 1, with a value of -1 meaning a total negative linear
correlation, 0 being no correlation, and + 1 meaning a total
positive correlation.
Rating Predictions

Pros/Cons of Collaborative Filtering
+ Works for any kind of item
No feature selection needed
- Cold Start:
Need enough users in the system to find a match
- Sparsity:
The user/ratings matrix is sparse
Hard to find users that have rated the same items
- First rater:
Cannot recommend an item that has not been
previously rated
New items, Esoteric items
- Popularity bias:
Cannot recommend items to someone with
unique taste
Tends to recommend popular items
Making predictions
 A common prediction function:

 Calculate, whether the neighbors' ratings for the unseen


item i are higher or lower than their average
 Combine the rating differences – use the similarity as a
weight
 Add/subtract the neighbors' bias from the active user's
average and use this as a prediction
Item-based collaborative filtering
 Basic idea:
 Use the similarity between items (and not users) to make
predictions
 Example:
 Look for items that are similar to Item5
 Take Alice's ratings for these items to predict the rating for
Item5 Item1 Item2 Item3 Item4 Item5
Alice 5 3 4 4 ?
User1 3 1 2 3 3
User2 4 3 4 3 5
User3 3 3 1 5 4
User4 1 5 5 2 1

You might also like