07 Recsys1
07 Recsys1
Search Recommendations
¡ Simple aggregates
§ Top 10, Most Popular, Recent Uploads
¡ Utility function u: X × S à R
§ R = set of ratings
§ R is a totally ordered set
§ e.g., 0-5 stars, real number in [0,1]
Alice
1 0.2
Bob
0.5 0.3
Carol
0.2 1
David
0.4
¡ Implicit
§ Learn ratings from user actions
§ E.g., purchase implies high rating
§ What about low ratings?
Example:
¡ Movie recommendations
§ Recommend movies with same actor(s),
director, genre, …
¡ Websites, blogs, news
§ Recommend other sites with “similar” content
build
recommend
match Red
Circles
Triangles
User profile
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 15
¡ For each item, create an item profile
Note: cosine similarity u(x,i) defined this way ranges [-1, 1],
to get it to [0,1] we take arc cos u(x,i).
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 18
¡ +: No need for data on other users
§ No cold-start or sparsity problems
¡ +: Able to recommend to users with
unique tastes
¡ +: Able to recommend new & unpopular items
§ No first-rater problem
¡ +: Able to provide explanations
§ Can provide explanations of recommended items by
listing content-features that caused an item to be
recommended
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 19
¡ –: Finding the appropriate features is hard
§ E.g., images, movies, music
¡ –: Recommendations for new users
§ How to build a user profile?
¡ –: Overspecialization
§ Never recommends items outside user’s
content profile
§ People might have multiple interests
§ Unable to exploit quality judgments of other users
§ Other options?
¡ Many other tricks possible…
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 25
¡ So far: User-user collaborative filtering
¡ Another view: Item-item
§ For item i, find other similar items
§ Estimate rating for item i based
on ratings for similar items
§ Can use same similarity metrics and
prediction functions as in user-user model
rxi =
å jÎN ( i ; x )
sij × rxj
å jÎN ( i ; x ) ij
s sij… similarity of items i and j
rxj…rating of user x on item j
N(i;x)… items similar to i and rated by user x
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 26
users
1 2 3 4 5 6 7 8 9 10 11 12
1 1 3 5 5 4
2 5 4 4 2 1 3
movies
3 2 4 1 2 3 4 3 5
4 2 4 5 4 2
5 4 3 4 2 2 5
6 1 3 3 2 4
1 1 3 ? 5 5 4
2 5 4 4 2 1 3
movies
3 2 4 1 2 3 4 3 5
4 2 4 5 4 2
5 4 3 4 2 2 5
6 1 3 3 2 4
3 2 4 1 2 3 4 3 5 0.41
4 2 4 5 4 2 -0.10
5 4 3 4 2 2 5 -0.31
6 1 3 3 2 4 0.59
Here we use Pearson correlation as similarity:
Neighbor selection: 1) Subtract mean rating mi from each movie i
Identify movies similar to m1 = (1+3+5+5+4)/5 = 3.6
row 1: [-2.6, 0, -0.6, 0, 0, 1.4, 0, 0, 1.4, 0, 0.4, 0]
movie 1, rated by user 5 2) Compute cosine similarities between rows
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 29
users
1 2 3 4 5 6 7 8 9 10 11 12
sim(1,m)
1 1 3 ? 5 5 4 1.00
2 5 4 4 2 1 3 -0.18
movies
3 2 4 1 2 3 4 3 5 0.41
4 2 4 5 4 2 -0.10
5 4 3 4 2 2 5 -0.31
6 1 3 3 2 4 0.59
1 1 3 2.6 5 5 4
2 5 4 4 2 1 3
movies
3 2 4 1 2 3 4 3 5
4 2 4 5 4 2
5 4 3 4 2 2 5
6 1 3 3 2 4
å s
jÎN ( i ; x ) ij
rxi = bxi +
å jÎN ( i ; x )
sij × ( rxj - bxj )
å s
jÎN ( i ; x ) ij
baseline estimate for rxi ¡ μ = overall mean movie rating
¡ bx = rating deviation of user x
𝒃𝒙𝒊 = 𝝁 + 𝒃𝒙 + 𝒃𝒊
= (avg. rating of user x) – μ
user x and item i
¡ bi = rating deviation of movie i
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 32
Avatar LOTR Matrix Pirates
Alice
1 0.8
Bob
0.5 0.3
Carol 0.9 1 0.8
David
1 0.4
¡ In practice, it has been observed that item-item
often works better than user-user
¡ Why? Items are simpler, users have multiple tastes
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 33
¡ + 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
2/13/17
§ Tends to recommend popular items
Jure Leskovec, Stanford C246: Mining Massive Datasets 34
¡ Implement two or more different
recommenders and combine predictions
§ Perhaps using a linear model
1 3 4
3 5 5
4 5 5
3
users
3
2 2 2
5
2 1 1
3 3
1
1 3 4
3 5 5
4 5 5
3
users
3
2 ? ?
Test Data Set
?
2 1 ?
3 ?
1
R4 C7
S3 R6 R3
R2
C2C4 a1 Flavored
B2 L4C3 S4 TE FR
F3 F2
B1 F9 F8 F1
F0 F6
R5 F5
R8
Popular Roasts F4
and Blends
Com plexity of Flavor
The bubbles above represent products sized by sales volume.
Products close to each other are recommended to each other.
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 45
[Bellkor Team]
serious Braveheart
The Color Amadeus
Purple
Dave
escapist
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 46
Koren, Bell, Volinksy, IEEE Computer, 2009
2/13/17 Jure Leskovec, Stanford C246: Mining Massive Datasets 47