collaborative filtering: models and algorithms › ~montanar › other › talks › ... ·...

88

Upload: others

Post on 29-Jun-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Collaborative Filtering: Models and Algorithms

Andrea Montanari

Jose Bento, Yash Deshpande, Adel Javanmard, Raghunandan Keshavan, Sewoong Oh,

Stratis Ioannidis, Nadia Fawaz, Amy Zhang

Stanford University, Technicolor

September 15, 2012

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 1 / 58

Page 2: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Problem statement

Given data on the activity of a set of users, provide personalizedrecommendations to users X, Y, Z,. . .

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 2 / 58

Page 3: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Example

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 3 / 58

Page 4: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

An obviously useful technology

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 4 / 58

Page 5: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

An obviously useful technology

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 5 / 58

Page 6: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Outline

1 A model

2 Algorithms and accuracy

3 Challenge #1: Privacy

4 Challenge #2: Interactivity

5 Conclusion

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 6 / 58

Page 7: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

A model

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 7 / 58

Page 8: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Setting

Users : i 2 f1; 2; : : : ;mg

Movies : j 2 f1; 2; : : : ;ng

When user i watches movie j , she enters her rating Rij .

Want to predict ratings for missing pairs.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 8 / 58

Page 9: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Setting

Users : i 2 f1; 2; : : : ;mg

Movies : j 2 f1; 2; : : : ;ng

When user i watches movie j , she enters her rating Rij .

Want to predict ratings for missing pairs.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 8 / 58

Page 10: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Linear regression model

Movie j

vj =�genre; main actor; supporting actor; year; . . .

� 2 Rr

Rij � ci + hui ; vj i+ "ij

Want: User parameters vector ui

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 9 / 58

Page 11: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Linear regression model

Movie j

vj =�genre; main actor; supporting actor; year; . . .

� 2 Rr

Rij � ci + hui ; vj i+ "ij

Want: User parameters vector ui

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 9 / 58

Page 12: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Linear regression model

Movie j

vj =�genre; main actor; supporting actor; year; . . .

� 2 Rr

Rij � ci + hui ; vj i+ "ij

Want: User parameters vector ui

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 9 / 58

Page 13: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Linear regression model

Movie j

vj =�genre; main actor; supporting actor; year; . . .

� 2 Rr

Rij ���ci + hui ; vj i+ "ij

Want: User parameters vector ui

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 10 / 58

Page 14: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Least squares

ui = arg minxi2Rr

8<: Xj2WatchedBy(i)

�Rij � hxi ; vj i

�29=;

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 11 / 58

Page 15: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Ridge regression

ui = arg minxi2Rr

8<: Xj2WatchedBy(i)

�Rij � hxi ; vj i

�2+ � kxik2

9=;

I How do we construct the vj 's?

I Ad hoc de�nitions are not suited to recommendation!

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 12 / 58

Page 16: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Ridge regression

ui = arg minxi2Rr

8<: Xj2WatchedBy(i)

�Rij � hxi ; vj i

�2+ � kxik2

9=;

I How do we construct the vj 's?

I Ad hoc de�nitions are not suited to recommendation!

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 12 / 58

Page 17: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

If I knew the users' feature vectors

Rij � hui ; vj i+ "ij

vj = arg minyj2Rr

8<: Xi2Watched(j )

�Rij � hui ; yj i

�2+ � kyj k2

9=;

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 13 / 58

Page 18: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

If I knew the users' feature vectors

Rij � hui ; vj i+ "ij

vj = arg minyj2Rr

8<: Xi2Watched(j )

�Rij � hui ; yj i

�2+ � kyj k2

9=;

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 13 / 58

Page 19: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Everything together

ui = arg minxi2Rr

8<: Xj2WatchedBy(i)

�Rij � hxi ; vj i

�2+ � kxik2

9=;vj = arg min

yj2Rr

8<: Xi2Watched(j )

�Rij � hui ; yj i

�2+ � kyj k2

9=;

Minimize (E =Watched)

F (X ;Y ) =X

(i ;j )2E

�Rij � hxi ; yj i

�2+ �

mXi=1

kxik22 + �nX

j=1

kyj k22

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 14 / 58

Page 20: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Everything together

ui = arg minxi2Rr

8<: Xj2WatchedBy(i)

�Rij � hxi ; vj i

�2+ � kxik2

9=;vj = arg min

yj2Rr

8<: Xi2Watched(j )

�Rij � hui ; yj i

�2+ � kyj k2

9=;

Minimize (E =Watched)

F (X ;Y ) =X

(i ;j )2E

�Rij � hxi ; yj i

�2+ �

mXi=1

kxik22 + �nX

j=1

kyj k22

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 14 / 58

Page 21: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Objective function

Minimize (E =Watched)

F (X ;Y ) =X

(i ;j )2E

�Rij � hxi ; yj i

�2+ �

mXi=1

kxik22 + �nX

j=1

kyj k22

� kPE (R�XY T)k2F + �kX k2F + �kY k2F

PE (A) =(Aij if (i ; j ) 2 E ;

0 otherwise

XT =hx1

���x2��� � � � ���xmiY T =

hy1

���y2��� � � � ���yniAndrea Montanari (Stanford) Collaborative Filtering September 15, 2012 15 / 58

Page 22: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Objective function

Minimize (E =Watched)

F (X ;Y ) =X

(i ;j )2E

�Rij � hxi ; yj i

�2+ �

mXi=1

kxik22 + �nX

j=1

kyj k22

� kPE (R�XY T)k2F + �kX k2F + �kY k2F

PE (A) =(Aij if (i ; j ) 2 E ;

0 otherwise

XT =hx1

���x2��� � � � ���xmiY T =

hy1

���y2��� � � � ���yniAndrea Montanari (Stanford) Collaborative Filtering September 15, 2012 15 / 58

Page 23: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Low rank structure

Low-rank M U

I V T

=m

n r

r

1. Low-rank matrix M

2. R = M+ Z

3. Observed subset E

PE (R)ij =(Mij + Zij if (i ; j ) 2 E ;0 otherwise.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 16 / 58

Page 24: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Low rank structure

Low-rank M U

I V T

=m

n r

r

1. Low-rank matrix M

2. R = M+ Z

3. Observed subset E

PE (R)ij =(Mij + Zij if (i ; j ) 2 E ;0 otherwise.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 16 / 58

Page 25: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Low rank structure

Low-rank M U

I V T

=m

n r

r

1. Low-rank matrix M

2. R = M+ Z

3. Observed subset E

PE (R)ij =(Mij + Zij if (i ; j ) 2 E ;0 otherwise.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 16 / 58

Page 26: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Low rank structure

Sample PE (R)m

n

1. Low-rank matrix M

2. R = M+ Z

3. Observed subset E

PE (R)ij =(Mij + Zij if (i ; j ) 2 E ;0 otherwise.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 16 / 58

Page 27: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Algorithms and accuracy

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 17 / 58

Page 28: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Questions

I How do we minimize F (X ;Y )?

I What prediction accuracy? (RMSE = kM� M̂kF=pmn)

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 18 / 58

Page 29: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

How do we minimize F (X ;Y )?

I Spectral methods.

I Gradient method. [Srebro, Rennie, Jaakkola, 2003]

I Convex relaxations. [Fazel, Hindi, Boyd, 2001]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 19 / 58

Page 30: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Spectral method (for simplicity � = 0)

Replace

F (X ;Y ) = kPE (R�XY T)k2F= kPE (XY T)k2F � 2hPE (R);XY Ti+ const:

with (p = jE j=mn fraction of observed entries)

eF (X ;Y ) = p kXY Tk2F � 2hPE (R);XY Ti+ const

= p

XY T � 1

pPE (R)

2F

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 20 / 58

Page 31: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Spectral method (for simplicity � = 0)

Replace

F (X ;Y ) = kPE (R�XY T)k2F= kPE (XY T)k2F � 2hPE (R);XY Ti+ const:

with (p = jE j=mn fraction of observed entries)

eF (X ;Y ) = p kXY Tk2F � 2hPE (R);XY Ti+ const

= p

XY T � 1

pPE (R)

2F

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 20 / 58

Page 32: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Spectral method (for simplicity � = 0)

Replace

F (X ;Y ) = kPE (R�XY T)k2F= kPE (XY T)k2F � 2hPE (R);XY Ti+ const:

with (p = jE j=mn fraction of observed entries)

eF (X ;Y ) = p kXY Tk2F � 2hPE (R);XY Ti+ const

= p

XY T � 1

pPE (R)

2F

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 20 / 58

Page 33: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Spectral method (for simplicity � = 0)

Minimize

eF (X ;Y ) =

XY T � 1

pPE (R)

2F

Solved by SVD

PE (R) = XSY T ) M̂ =1

pXm�r (S)r�rY

T

n�r

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 21 / 58

Page 34: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Spectral method (for simplicity � = 0)

Minimize

eF (X ;Y ) =

XY T � 1

pPE (R)

2F

Solved by SVD

PE (R) = XSY T ) M̂ =1

pXm�r (S)r�rY

T

n�r

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 21 / 58

Page 35: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Random matrix r = 4, m = n = 10000, p = 0:0012

0 10 20 30 40 50 60 70 800

10

20

30

40

�1�2�3�4

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 22 / 58

Page 36: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Net�ix data (trimmed)

0 20 40 60 80 100 120 1400

20

40

60

80

100

120

140

RMSE � 0:99

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 23 / 58

Page 37: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees

Theorem (Keshavan, M, Oh, 2009)

Qssume jMij j � Mmax. Then, w.h.p., rank-r projection achieves

RMSE � CMmax

qnr=jE j+C 0 kZEk2 n

pr=jE j :

E.g. Gaussian noise: C 00(1+ �z )pr n=jE j

[Improves over Achlioptas-McSherry 2003]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 24 / 58

Page 38: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Gradient descent

F (X ;Y ) =X

(i ;j )2E

�Rij � hxi ; yj i

�2+ �

mXi=1

kxik22 + �nX

j=1

kyj k22

Update rule: ( = `learning rate')

xi (1� � )xi + X

j2WatchedBy(i)

�Rij � hxi ; yj i

�yj

yj (1� � )yj + X

i2Watched(j )

�Rij � hxi ; yj i

�xi

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 25 / 58

Page 39: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Gradient descent

F (X ;Y ) =X

(i ;j )2E

�Rij � hxi ; yj i

�2+ �

mXi=1

kxik22 + �nX

j=1

kyj k22

Update rule: ( = `learning rate')

xi (1� � )xi + X

j2WatchedBy(i)

�Rij � hxi ; yj i

�yj

yj (1� � )yj + X

i2Watched(j )

�Rij � hxi ; yj i

�xi

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 25 / 58

Page 40: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Interpretation

xi (1� � )xi + X

j2WatchedBy(i)

wij yj

yj (1� � )yj + X

i2Watched(j )

wij xi

user avg of movies she liked

movie avg of users that liked it

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 26 / 58

Page 41: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Interpretation

xi (1� � )xi + X

j2WatchedBy(i)

wij yj

yj (1� � )yj + X

i2Watched(j )

wij xi

user avg of movies she liked

movie avg of users that liked it

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 26 / 58

Page 42: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

A variant (stochastic gradient)

Pick (i ; j ) 2 E :

xi (1� � )xi + wij yj

yj (1� � )yj + wij xi

[Srebro, Rennie, Jaakkola, 2003]

[Srebro, Jaakkola, 2005]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 27 / 58

Page 43: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

A variant (stochastic gradient)

Pick (i ; j ) 2 E :

xi (1� � )xi + wij yj

yj (1� � )yj + wij xi

[Srebro, Rennie, Jaakkola, 2003]

[Srebro, Jaakkola, 2005]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 27 / 58

Page 44: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

In the words of SimonFunk

[Ne�ix challenge, 2006-2009]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 28 / 58

Page 45: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

And his results

Target RMSE � 0:8564

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 29 / 58

Page 46: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Three variants

0.7

0.75

0.8

0.85

0.9

0.95

1

1.05

1.1

0 5 10 15 20 25 30 35

Message PassingAlt. Min.OptSpace

iterations

RMSE

OptSpace � Gradient descent on Grassmannian [Keshavan-M.-Oh 2009]Alternating Least Squares [Koren-Bell 2008]

Message Passing [Keshavan-M. 2011]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 30 / 58

Page 47: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees: Vignette (m = n = 2000 rank-8)

low-rank matrix M sampled matrix ME

OptSpace output M̂ squared error (M� M̂)2

0:25% sampled

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 31 / 58

Page 48: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees: Vignette (m = n = 2000 rank-8)

low-rank matrix M sampled matrix ME

OptSpace output M̂ squared error (M� M̂)2

0:50% sampled

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 31 / 58

Page 49: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees: Vignette (m = n = 2000 rank-8)

low-rank matrix M sampled matrix ME

OptSpace output M̂ squared error (M� M̂)2

0:75% sampled

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 31 / 58

Page 50: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees: Vignette (m = n = 2000 rank-8)

low-rank matrix M sampled matrix ME

OptSpace output M̂ squared error (M� M̂)2

1:00% sampled

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 31 / 58

Page 51: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees: Vignette (m = n = 2000 rank-8)

low-rank matrix M sampled matrix ME

OptSpace output M̂ squared error (M� M̂)2

1:25% sampled

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 31 / 58

Page 52: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees: Vignette (m = n = 2000 rank-8)

low-rank matrix M sampled matrix ME

OptSpace output M̂ squared error (M� M̂)2

1:50% sampled

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 31 / 58

Page 53: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees: Vignette (m = n = 2000 rank-8)

low-rank matrix M sampled matrix ME

OptSpace output M̂ squared error (M� M̂)2

1:75% sampled

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 31 / 58

Page 54: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees: Unstructured factors

Incoherence

kuik2 � � hku�k2iav ; kvj k22 � � hkv�k2iav :

[Candés, Recht 2008]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 32 / 58

Page 55: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees

Theorem (Keshavan, M, Oh, 2009)

Assume jMij j � Mmax. Then, w.h.p., rank-r projection achieves

RMSE � CMmax

qnr=jE j+C 0 kZEk2 n

pr=jE j :

Theorem (Keshavan, M, Oh, 2009)

Let M be incoherent with �1(M )=�r (M ) = O(1). IfjE j � Cn minfr(logn)2; r2 logng then, w.h.p., OptSpace achieves

RMSE � C 00npr

jE j kZEk2 ;

with complexity O(nr3(logn)2).

E.g. Gaussian noise: C 00�zpr n=jE j

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 33 / 58

Page 56: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Accuracy guarantees

Theorem (Keshavan, M, Oh, 2009)

Assume jMij j � Mmax. Then, w.h.p., rank-r projection achieves

RMSE � CMmax

qnr=jE j+C 0 kZEk2 n

pr=jE j :

Theorem (Keshavan, M, Oh, 2009)

Let M be incoherent with �1(M )=�r (M ) = O(1). IfjE j � Cn minfr(logn)2; r2 logng then, w.h.p., OptSpace achieves

RMSE � C 00npr

jE j kZEk2 ;

with complexity O(nr3(logn)2).

E.g. Gaussian noise: C 00�zpr n=jE j

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 33 / 58

Page 57: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Two surprises

Can do much better than SVD !

Error = Noise = Sampling factor

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 34 / 58

Page 58: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Analogous guarantees for convex relaxations

Candés, Recht, 2008 �

Candés, Plan, 2009

Candés, Tao, 2009

Gross, 2010

Negahbahn, Wainwright, 2010

Koltchinskii, Lounici, Tsybakov, 2011

. . .

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 35 / 58

Page 59: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

A noisy example

I n = 500; r = 4; �z = 1, example from [Candés, Plan, 2009]

0

0.2

0.4

0.6

0.8

1

1.2

1.4

0 100 200 300 400 500

rank-r projectionSDP

ADMiRAOptSpace

Oracle Bound

RMSE

jE j=nAndrea Montanari (Stanford) Collaborative Filtering September 15, 2012 36 / 58

Page 60: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Challenge #1: Privacy

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 37 / 58

Page 61: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Research question

User ratings ! User feature vector

User ratings ! User private attributes ???

Let us try to do it!

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 38 / 58

Page 62: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Research question

User ratings ! User feature vector

User ratings ! User private attributes ???

Let us try to do it!

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 38 / 58

Page 63: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Research question

User ratings ! User feature vector

User ratings ! User private attributes ???

Let us try to do it!

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 38 / 58

Page 64: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Which attribute?

Number of persons in the household

I Non-obvious

I Recommender has incentive

I 2011 CAMRa Challenge [ no prize :-( we won it :-) ]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 39 / 58

Page 65: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Which attribute?

Number of persons in the household

I Non-obvious

I Recommender has incentive

I 2011 CAMRa Challenge [ no prize :-( we won it :-) ]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 39 / 58

Page 66: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

CAMRa dataset

I m � 2 � 105 users, n � 2 � 104 movies

I jE j � 4:5 � 106 ratings (p � 0:001)

I 272 households of size 2

I 14 households of size 3

I 4 households of size 4

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 40 / 58

Page 67: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

CAMRa dataset

I m � 2 � 105 users, n � 2 � 104 movies

I jE j � 4:5 � 106 ratings (p � 0:001)

I 272 households of size 2

I((((((((((((14 households of size 3

I(((((((((((4 households of size 4

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 41 / 58

Page 68: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

CAMRa dataset

I m � 2 � 105 users, n � 2 � 104 movies

I jE j � 4:5 � 106 ratings (p � 0:001)

I 272 households of size 2

I Can you identify whether two users shared an account?

I Can you identify which user watched a movie?

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 42 / 58

Page 69: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Short answer

Yes: For a signi�cant fraction of the accounts.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 43 / 58

Page 70: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Two examples (Net�ix dataset, no ground truth)

No movie info used!

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 44 / 58

Page 71: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

How did you do it?

Rij � hui ; vj i+ "ij

n(Rij ;�vj ) 2 Rr+1; j 2WatchedBy(i)

o� Hyperplane

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 45 / 58

Page 72: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

How did you do it?

Rij � hui ; vj i+ "ij

n(Rij ;�vj ) 2 Rr+1; j 2WatchedBy(i)

o� Hyperplane

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 45 / 58

Page 73: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

How did you do it? Subspace clustering

One user ! One hyperplaneTwo users ! Two hyperplanes

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 46 / 58

Page 74: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Example: A two-user household (CAMRa)

−2 −1.5 −1 −0.5 0 0.5 1 1.5 20

10

20

30

40

50

60

70

80

Difference of distances of xj from the two hyperplanes

Nu

mb

er

of

mo

vie

ra

tin

g e

ve

nts

Distance Difference Distribution for household 172, with similarity score 0.898117

User 1

User 2

Normal fit (−)

Normal fit (+)

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 47 / 58

Page 75: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Example: Another two-user household (CAMRa)

−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.50

20

40

60

80

100

120

Difference of distances of xj from the two hyperplanes

Num

ber

of m

ovie

rating e

vents

Distance Difference Distribution for household 124, with similarity score 0.500787

User 1

User 2

Normal fit in µ ± 1.5σ

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 48 / 58

Page 76: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Classifying households

0 50 100 150 2000

0.02

0.04

0.06

0.08

(MSE1−MSE

2) × m / log(m)

PD

F

MOVIEX

Size 1, Empirical

Size 2, Empirical

Size 1, Fitted Gamma

Size 2, Fitted Gamma

MSE1 ! MSE using one hyperplaneMSE2 ! MSE using two hyperplanes

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 49 / 58

Page 77: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Challenge #2: Interactivity

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 50 / 58

Page 78: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

We want to design the system

User Recommender

We took time out of the picture.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 51 / 58

Page 79: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

We want to design the system

User Recommender

We took time out of the picture.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 51 / 58

Page 80: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Interactive system

User Recom.

User Recom.

User Recom.

t = 1

t = 2

t = 3

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 52 / 58

Page 81: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Abstract from other users

At time t

I Recommender suggests movie vt ;

I User gives feedback Rt

Focus on user u

Rt � hu ; vt i+ "t

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 53 / 58

Page 82: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Abstract from other users

At time t

I Recommender suggests movie vt ;

I User gives feedback Rt

Focus on user u

Rt � hu ; vt i+ "t

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 53 / 58

Page 83: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Linear bandits

Decision:

vt

Observations:

Rt � hu ; vt i+ "t

Reward:

Ot =tX

`=1

hu ; v`i

[Rusmevichientong, Tsitsiklis, 2008]

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 54 / 58

Page 84: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Important di�erences

I Number of observations � Dimensions

I Cannot explore completely at random.

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 55 / 58

Page 85: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Simulating an interactive system (Net�ix data)

0 5 10 15 20 25 30

0

2

4

6

8

10

t

Cum

ula

tive

Rew

ard

0 5 10 15 20 25 30

0

2

4

6

8

t

Cum

ula

tive

Rew

ard

0 5 10 15 20 25 30

0

2

4

6

8

t

Cum

ula

tive

Rew

ard

I 3 `typical' users

I Constant-optimal policy

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 56 / 58

Page 86: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Conclusion

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 57 / 58

Page 87: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Conclusion

I A crucial technology for modern information networks.

I Only scratched the surface.

Thanks!

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 58 / 58

Page 88: Collaborative Filtering: Models and Algorithms › ~montanar › OTHER › TALKS › ... · Collaborative Filtering: Models and Algorithms Andrea Montanari Jose Bento, ashY Deshpande,

Conclusion

I A crucial technology for modern information networks.

I Only scratched the surface.

Thanks!

Andrea Montanari (Stanford) Collaborative Filtering September 15, 2012 58 / 58