limited product diversity • Online retailers: cater to eclectic/niche preferences, rare and less popular items • However, users need to be able to discover those rare and niche items! • Recommendation systems provide a way 2 Thursday, December 13, 12
• Predict how a user U will rate an item I • user ‘likes’ a story on Facebook • user gives a movie 4/5 stars on Netflix • Find items likely to be rated highly by a user • Examples of items: movies (Netflix), products (Amazon), stories (Facebook) 4 Thursday, December 13, 12
by users with similar preferences • Content-based: recommend items similar intrinsically to previous items highly rated by user • Latent Factor Models: Use techniques from Linear Algebra to extract hidden features, on which predictions are based • Hybrid Systems: combine different approaches 7 Thursday, December 13, 12
users {N}, who have preferences similar to U • Predict U’s ratings based on ratings of other users in {N} • How do we find users similar to U? • We use a similarity metric 8 Thursday, December 13, 12
assigned a higher similarity score if and only if: • C and D watch many of the same movies • C and D rate the same movies similarly • Several similarity metrics meet these conditions. Let’s look at one... 10 Thursday, December 13, 12
ratings • Cosine similarity of u and v: u.v/|u||v| • Always in the range [0,1] • Higher value => Greater similarity • Cosine of the angle θ between u,v θ v u 11 Thursday, December 13, 12
SW6 A 4 5 5 1 B 2 3 2 3 C 3 5 4 4 D 3 2 2 4 5 4 A B C D A 1 0.26 0.26 0.04 B 0.26 1 0.7 0.57 C 0.26 0.7 1 0.44 D 0.04 0.57 0.44 1 Takes into account: i) number of items in common ii) similarity of ratings C is more similar to D than A 12 Thursday, December 13, 12
by a user u to an item i? • Use the similarity metric to find the similarity of other users to u • Find top K most similar neighbors to u who have rated item i • Average the neighbors’ ratings for i 13 Thursday, December 13, 12
SW6 A 4 5 5 1 B 2 3 2 3 C 3 5 4 4 ??? D 3 2 2 4 5 4 Example: How would user C rate movie SW4? Choosing K=2, Top K neighbors for C who have rated SW4 are B and D (0.7x3 + 0.44x4)/(0.7 + 0.44) = 3.39 A B C D A 1 0.26 0.26 0.04 B 0.26 1 0.7 0.57 C 0.26 0.7 1 0.44 D 0.04 0.57 0.44 1 14 Thursday, December 13, 12
who like this also like...” • Could we use the same approach for items? • “You may also like...” • Yes! Item-based similarity: dual of user-based • Items rated similarly by the same user get higher similarity score • Predict ratings for a new item based on ratings by a user for similar items 15 Thursday, December 13, 12
3 3 C 3 5 D 3 4 Treat the columns as vectors and calculate similarity between them HP1 TW1 SW4 HP1 1 0.7 0.22 TW1 0.7 1 0.63 SW4 0.22 0.63 1 Example: How would user C rate movie SW4? Similar to user-based method, choosing K = 2 Top 2 movies similar to SW4 rated by C are HP1 and TW1 (0.63x5 + 0.22x3)/(0.63 + 0.22) = 4.48 16 Thursday, December 13, 12
• In practice, item-based works better • Items are less ‘complicated’ than people • Easier to categorize items • Better performance: needs fewer neighbors to get accurate prediction Example: CD similar to Mozart, Beethoven, Bach => classical. Not same for users A user typically rates only a small fraction of items, so less items to iterate over 17 Thursday, December 13, 12
item/user • Fraud/Attacks: fake items/ratings • Sparsity of utility matrix • Implicit features: what do users actually like? • How can we address these problems? • Use recommendations based on intrinsic properties of users/items (content-based models) • Use linear algebra to extract useful features and reduce sparsity (latent factor models) 18 Thursday, December 13, 12
by users with similar preferences • Content-based: recommend items similar intrinsically to previous items highly rated by user • Latent Factor Models: Use techniques from Linear Algebra to extract hidden features, on which predictions are based • Hybrid Systems: combine different approaches 19 Thursday, December 13, 12
• Use machine learning (clustering and classification) to find similar items/users • Profile vectors composed of features designed to reflect intrinsic properties • What features? 20 Thursday, December 13, 12
Rickman Harrison Ford HP1 1 0 1 1 0 1 0 TW1 1 0 0 1 0 0 0 SW4 0 1 1 0 1 0 1 • How do we use these feature vectors? Here’s one way: • Calculate similarity between movie profile vectors • Similar to item-based CF, use weighted average • Many other algorithms can be applied Talk about problems with content based systems - need to decide and add features manually 22 Thursday, December 13, 12
users/items • Use a weighted average of neighbors’ ratings to predict unknown rating • Collaborative filtering: behavioral similarity • Content-based systems: intrinsic similarity 23 Thursday, December 13, 12
by users with similar preferences • Content-based: recommend items similar (intrinsically) to previous items highly rated by user • Latent Factor Models: Use techniques from Linear Algebra to extract hidden features, on which predictions are based • Hybrid Systems: combine different approaches 24 Thursday, December 13, 12
denser? • Can we gain some insight into what user preferences actually mean? • Linear algebra techniques can uncover these latent (hidden) factors • SVD: singular value decomposition 25 Thursday, December 13, 12
matrix • Use low-dim vectors in to calculate similarity Dim 1 Dim 2 A 0.9 -0.8 B 0.1 0.3 C 0.24 0.85 D -0.89 0.4 HP1 HP2 HP3 TW1 TW2 TW3 SW4 SW5 SW6 A 4 5 5 1 B 2 3 2 3 C 3 5 4 4 D 3 2 2 4 5 4 We have reduced each user from a sparser 9-D vector to a 2-D vector. How can we interpret the dimensions here? Perhaps as “user tastes” or “movie genres”. SVD 26 Thursday, December 13, 12
B 0.1 0.3 C 0.24 0.85 D -0.89 0.4 HP1 HP2 HP3 TW1 TW2 TW3 SW4 SW5 SW6 A 4 5 5 1 B 2 3 2 3 C 3 5 4 4 D 3 2 2 4 5 4 A D C B Female Fantasy Male Sci-Fi In this case we interpret the SVD approximation as showing: Dim 1: Sci-Fi to Fantasy Dim 2: Male to Female Note: C is closer to D than A 27 Thursday, December 13, 12
by users with similar preferences • Content-based: recommend items similar (intrinsically) to previous items highly rated by user • Latent Factor Models: Use mathematical techniques to extract hidden features, on which predictions are based • Hybrid Systems: combine different approaches • Let’s look at a case study 28 Thursday, December 13, 12
parameters for each user & movie • Ratings are deviations from user/movie-specific bias • Incorporate temporal shifts in model • User ratings change based on time • Algorithms parametrized by time • Focus on good ways to blend algorithms • GBDT: Gradient boosted decision trees 30 Thursday, December 13, 12
latent-factor (SVD) • Hybrid: combinations of the above • So which algorithm should you use? • Depends on your use case and business 31 Thursday, December 13, 12
your business? (e.g. Netflix, Amazon) • You should be using a hybrid system • Spend a lot of effort tuning based on domain- specific knowledge • Find innovative ways to combine different kinds of features 32 Thursday, December 13, 12
factor (SVD) based models may extract the “essence” of your data • YMMV on whether they provide usable insights into customer behavior • Otherwise... • Collaborative filtering models: fast and easy to implement and test 33 Thursday, December 13, 12
ratings • (How often do you rate stuff?) • Collect better data without annoying users • Games to collect ratings information • “gamification”, work of Luis von Ahn • NLP to parse reviews & other sources • sentiment analysis to infer ratings 34 Thursday, December 13, 12
your twitter feed for content • Use your social graph to identify similar users/friends • Recommend across genres/categories 35 Thursday, December 13, 12
• Recommender Systems: Melville and Sindhwani, IBM Research • Mining of Massive Datasets (Ch 9): Rajaraman, Ullman and Leskovec, Stanford University • The Bellkor Solution to the Netflix Grand Prize: Bell and Koren, AT&T labs 36 Thursday, December 13, 12