Recommender Systems: Content-based Systems & Collaborative Filtering

Slides:



Advertisements
Similar presentations
Recommender Systems & Collaborative Filtering
Advertisements

Content-based Recommendation Systems
Similarity and Distance Sketching, Locality Sensitive Hashing
1 RegionKNN: A Scalable Hybrid Collaborative Filtering Algorithm for Personalized Web Service Recommendation Xi Chen, Xudong Liu, Zicheng Huang, and Hailong.
Filtering and Recommender Systems Content-based and Collaborative Some of the slides based On Mooney’s Slides.
Recommender Systems Aalap Kohojkar Yang Liu Zhan Shi March 31, 2008.
Rubi’s Motivation for CF  Find a PhD problem  Find “real life” PhD problem  Find an interesting PhD problem  Make Money!
CS 345A Data Mining Lecture 1
CS345 Data Mining Recommendation Systems Netflix Challenge Anand Rajaraman, Jeffrey D. Ullman.
Database Management Systems, R. Ramakrishnan1 Computing Relevance, Similarity: The Vector Space Model Chapter 27, Part B Based on Larson and Hearst’s slides.
CS 345A Data Mining Lecture 1 Introduction to Web Mining.
1 Collaborative Filtering and Pagerank in a Network Qiang Yang HKUST Thanks: Sonny Chee.
Recommendations via Collaborative Filtering. Recommendations Relevant for movies, restaurants, hotels…. Recommendation Systems is a very hot topic in.
Recommender systems Ram Akella February 23, 2011 Lecture 6b, i290 & 280I University of California at Berkeley Silicon Valley Center/SC.
1 Introduction to Recommendation System Presented by HongBo Deng Nov 14, 2006 Refer to the PPT from Stanford: Anand Rajaraman, Jeffrey D. Ullman.
CS 345 Data Mining Lecture 1 Introduction to Web Mining.
Recommender systems Ram Akella November 26 th 2008.
Mining of Massive Datasets Jure Leskovec, Anand Rajaraman, Jeff Ullman Stanford University Note to other teachers and users of these.
Recommendation Systems
Chapter 12 (Section 12.4) : Recommender Systems Second edition of the book, coming soon.
Distributed Networks & Systems Lab. Introduction Collaborative filtering Characteristics and challenges Memory-based CF Model-based CF Hybrid CF Recent.
17 E-commerce 2 Aaron Schiff ECON Reading: Deak p. 3-5, p , p , p. 44, p
1 Information Filtering & Recommender Systems (Lecture for CS410 Text Info Systems) ChengXiang Zhai Department of Computer Science University of Illinois,
Group Recommendations with Rank Aggregation and Collaborative Filtering Linas Baltrunas, Tadas Makcinskas, Francesco Ricci Free University of Bozen-Bolzano.
EMIS 8381 – Spring Netflix and Your Next Movie Night Nonlinear Programming Ron Andrews EMIS 8381.
1 Recommender Systems Collaborative Filtering & Content-Based Recommending.
Machine Learning in Ad-hoc IR. Machine Learning for ad hoc IR We’ve looked at methods for ranking documents in IR using factors like –Cosine similarity,
1 Computing Relevance, Similarity: The Vector Space Model.
Collaborative Filtering  Introduction  Search or Content based Method  User-Based Collaborative Filtering  Item-to-Item Collaborative Filtering  Using.
Evaluation of Recommender Systems Joonseok Lee Georgia Institute of Technology 2011/04/12 1.
1 Collaborative Filtering & Content-Based Recommending CS 290N. T. Yang Slides based on R. Mooney at UT Austin.
Recommender Systems Debapriyo Majumdar Information Retrieval – Spring 2015 Indian Statistical Institute Kolkata Credits to Bing Liu (UIC) and Angshul Majumdar.
Data Mining: Knowledge Discovery in Databases Peter van der Putten ALP Group, LIACS Pre-University College LAPP-Top Computer Science February 2005.
CS425: Algorithms for Web Scale Data Most of the slides are from the Mining of Massive Datasets book. These slides have been modified for CS425. The original.
Pairwise Preference Regression for Cold-start Recommendation Speaker: Yuanshuai Sun
Collaborative Filtering via Euclidean Embedding M. Khoshneshin and W. Street Proc. of ACM RecSys, pp , 2010.
User Modeling and Recommender Systems: recommendation algorithms
Presented By: Madiha Saleem Sunniya Rizvi.  Collaborative filtering is a technique used by recommender systems to combine different users' opinions and.
Analysis of massive data sets Prof. dr. sc. Siniša Srbljić Doc. dr. sc. Dejan Škvorc Doc. dr. sc. Ante Đerek Faculty of Electrical Engineering and Computing.
Item-Based Collaborative Filtering Recommendation Algorithms
Unsupervised Learning
Announcements Paper presentation Project meet with me ASAP
Matrix Factorization and Collaborative Filtering
Recommender Systems 11/04/2017
High dim. data Graph data Infinite data Machine learning Apps
22C:145 Artificial Intelligence
Statistics 202: Statistical Aspects of Data Mining
Data Mining: Concepts and Techniques
Recommender Systems & Collaborative Filtering
Recommender Systems 01 , Content Based , Collaborative Filtering
CF Recommenders.
CS728 The Collaboration Graph
مهندسی سيستم‌هاي تجارت الکترونيک
Introduction to Web Mining
Adopted from Bin UIC Recommender Systems Adopted from Bin UIC.
Recommender Systems.
Step-By-Step Instructions for Miniproject 2
Advanced Artificial Intelligence
Q4 : How does Netflix recommend movies?
Author: Kazunari Sugiyama, etc. (WWW2004)
Recommender Systems: Content-based Systems & Collaborative Filtering
Recommender Systems Copyright: Dietmar Jannah, Markus Zanker and Gerhard Friedrich (slides based on their IJCAI talk „Tutorial: Recommender Systems”)
Collaborative Filtering Non-negative Matrix Factorization
CS 345A Data Mining Lecture 1
Recommendation Systems
Recommender Systems Group 6 Javier Velasco Anusha Sama
CS 345A Data Mining Lecture 1
Introduction to Web Mining
CS 345A Data Mining Lecture 1
Unsupervised Learning
Presentation transcript:

Recommender Systems: Content-based Systems & Collaborative Filtering Note to other teachers and users of these slides: We would be delighted if you found this our material useful in giving your own lectures. Feel free to use these slides verbatim, or to modify them to fit your own needs. If you make use of a significant portion of these slides in your own lecture, please include this message, or a link to our web site: http://www.mmds.org Recommender Systems: Content-based Systems & Collaborative Filtering

High Dimensional Data High dim. data Graph data Infinite data Locality sensitive hashing Clustering Dimensionality reduction Graph data PageRank, SimRank Community Detection Spam Detection Infinite data Filtering data streams Web advertising Queries on streams Machine learning SVM Decision Trees Perceptron, kNN Apps Recommender systems Association Rules Duplicate document detection

Example: Recommender Systems Customer X Buys Metallica CD Buys Megadeth CD Customer Y Does search on Metallica Recommender system suggests Megadeth from data collected about customer X

Recommendations Examples: Search Recommendations Items Products, web sites, blogs, news items, …

From Scarcity to Abundance Shelf space is a scarce commodity for traditional retailers Also: TV networks, movie theaters,… Web enables near-zero-cost dissemination of information about products From scarcity to abundance More choice necessitates better filters Recommendation engines How Into Thin Air made Touching the Void a bestseller: http://www.wired.com/wired/archive/12.10/tail.html In 1988, a British mountain climber named Joe Simpson wrote a book called Touching the Void, a harrowing account of near death in the Peruvian Andes. It got good reviews but, only a modest success, it was soon forgotten. Then, a decade later, a strange thing happened. Jon Krakauer wroteInto Thin Air, another book about a mountain-climbing tragedy, which became a publishing sensation. SuddenlyTouching the Void started to sell again. Random House rushed out a new edition to keep up with demand. Booksellers began to promote it next to their Into Thin Air displays, and sales rose further. A revised paperback edition, which came out in January, spent 14 weeks on theNew York Times bestseller list. That same month, IFC Films released a docudrama of the story to critical acclaim. NowTouching the Void outsells Into Thin Air more than two to one. What happened? In short, Amazon.com recommendations. The online bookseller's software noted patterns in buying behavior and suggested that readers who liked Into Thin Airwould also like Touching the Void. People took the suggestion, agreed wholeheartedly, wrote rhapsodic reviews. More sales, more algorithm-fueled recommendations, and the positive feedback loop kicked in.

Sidenote: The Long Tail Source: Chris Anderson (2004)

Read http://www.wired.com/wired/archive/12.10/tail.html to learn more! Physical vs. Online Read http://www.wired.com/wired/archive/12.10/tail.html to learn more!

Types of Recommendations Editorial and hand curated List of favorites Lists of “essential” items Simple aggregates Top 10, Most Popular, Recent Uploads Tailored to individual users Amazon, Netflix, …

Formal Model X = set of Customers S = set of Items 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]

Utility Matrix Avatar LOTR Matrix Pirates Alice Bob Carol David Find out blank David

Key Problems (1) Gathering “known” ratings for matrix How to collect the data in the utility matrix (2) Extrapolate unknown ratings from the known ones Mainly interested in high unknown ratings We are not interested in knowing what you don’t like but what you like (3) Evaluating extrapolation methods How to measure success/performance of recommendation methods

(1) Gathering Ratings Explicit Implicit Ask people to rate items Doesn’t work well in practice – people can’t be bothered Implicit Learn ratings from user actions E.g., purchase implies high rating What about low ratings?

More on ratings – Explicit ratings Probably the most precise ratings Most commonly used (1 to 5, 1 to 7 Likert response scales) Research topics Optimal granularity of scale; indication that 10-point scale is better accepted in movie dom. An even more fine-grained scale was chosen in the joke recommender discussed by Goldberg et al. (2001), where a continuous scale (from −10 to +10) and a graphical input bar were used No precision loss from the discretization User preferences can be captured at a finer granularity Users actually "like" the graphical interaction method Multidimensional ratings (multiple ratings per movie such as ratings for actors and sound) Main problems Users not always willing to rate many items number of available ratings could be too small → sparse rating matrices → poor recommendation quality How to stimulate users to rate more items?

More on ratings – Implicit ratings Typically collected by the web shop or application in which the recommender system is embedded When a customer buys an item, for instance, many recommender systems interpret this behavior as a positive rating Clicks, page views, time spent on some page, demo downloads … Implicit ratings can be collected constantly and do not require additional efforts from the side of the user Main problem One cannot be sure whether the user behavior is correctly interpreted For example, a user might not like all the books he or she has bought; the user also might have bought a book for someone else Implicit ratings can be used in addition to explicit ones; question of correctness of interpretation

(2) Extrapolating Utilities Key problem: Utility matrix U is sparse Most people have not rated most items Cold start: New items have no ratings New users have no history Three approaches to recommender systems: 1) Content-based 2) Collaborative 3) Latent factor based Today!

Content-based Recommender Systems

Content-based Recommendations Main idea: Recommend items to customer x similar to previous items rated highly by x Example: Movie recommendations Recommend movies with same actor(s), director, genre, … Websites, blogs, news Recommend other sites with “similar” content

Plan of Action Item profiles User profile likes build recommend Red Circles Triangles match User profile

Item Profiles For each item, create an item profile Profile is a set (vector) of features Movies: author, title, actor, director,… Text: Set of “important” words in document How to pick important features? Usual heuristic from text mining is TF-IDF (Term frequency * Inverse Doc Frequency) Term … Feature Document … Item

Sidenote: TF-IDF fij = frequency of term (feature) i in doc (item) j ni = number of docs that mention term i N = total number of docs TF-IDF score: wij = TFij × IDFi Doc profile = set of words with highest TF-IDF scores, together with their scores Note: we normalize TF to discount for “longer” documents

User Profiles and Prediction User profile possibilities: Weighted average of rated item profiles Variation: weight by difference from average rating for item … Prediction heuristic: Given user profile x and item profile i, estimate 𝑢(𝒙,𝒊) = cos⁡(𝒙,𝒊) = 𝒙·𝒊 | 𝒙 |⋅| 𝒊 |

 Item profile: vector with 0 or 1 for each Actor  Items are movies, only feature is “Actor”  Item profile: vector with 0 or 1 for each Actor  Suppose user x has watched 5 movies  2 movies featuring actor A  3 movies featuring actor B  User profile = mean of item profiles  Feature A’s weight = 2/5 = 0.4  Feature B’s weight = 3/5 = 0.6

 Actor A’s movies rated 3 and 5  Actor B’s movies rated 1, 2 and 4  Same example, 1-­‐5 star ratings  Actor A’s movies rated 3 and 5  Actor B’s movies rated 1, 2 and 4  Useful step: Normalize ratings by subtracting user’s mean rating (3)  Actor A’s normalized ratings = 0, +2  Profile weight = (0 + 2)/2 = 1  Actor B’s normalized ratings = -­‐2, -­‐1, +1  Profile weight = -­‐2/3

θ  User profile x, Item profile i  Estimate U(x,i) = cos(θ) = (x . i)/(|x||i|) x i θ Technically, the cosine distance is actually the angle θ And the cosine similarity is the angle 180-θ For convenience, we use cos(θ) as our similarity measure and call it the “cosine similarity” in this context. 10

Pros: Content-based Approach +: 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

Cons: Content-based Approach –: 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

Collaborative Filtering Harnessing quality judgments of other users

Collaborative Filtering Consider user x Find set N of other users whose ratings are “similar” to x’s ratings Estimate x’s ratings based on ratings of users in N x N

Similarity Metric Consider user x and y with rating vector rx and ry We need a similarity metric sim(x, y) Intuitively we want: sim(A, B) > sim(A, C)

Finding “Similar” Users rx = [*, _, _, *, ***] ry = [*, _, **, **, _] Let rx be the vector of user x’s ratings Jaccard similarity measure Problem: Ignores the value of the rating Cosine similarity measure sim(x, y) = cos(rx, ry) = 𝑟 𝑥 ⋅ 𝑟 𝑦 || 𝑟 𝑥 ||⋅ ||𝑟 𝑦 || Problem: Treats missing ratings as “negative” Pearson correlation coefficient Sxy = items rated by both users x and y rx, ry as sets: rx = {1, 4, 5} ry = {1, 3, 4} rx, ry as points: rx = {1, 0, 0, 1, 3} ry = {1, 0, 2, 2, 0} -- Jaccard is not appropriate as we want to consider weights 0,-1,-1,0,2 0,-1,1,1,-1 𝒔𝒊𝒎 𝒙,𝒚 = 𝒔∈ 𝑺 𝒙𝒚 𝒓 𝒙𝒔 − 𝒓 𝒙 𝒓 𝒚𝒔 − 𝒓 𝒚 𝒔∈ 𝑺 𝒙𝒚 𝒓 𝒙𝒔 − 𝒓 𝒙 𝟐 𝒔∈ 𝑺 𝒙𝒚 𝒓 𝒚𝒔 − 𝒓 𝒚 𝟐 rx, ry … avg. rating of x, y

Similarity Metric Intuitively we want: sim(A, B) > sim(A, C) Cosine sim: Similarity Metric 𝒔𝒊𝒎(𝒙, 𝒚) = 𝒊 𝒓 𝒙𝒊 ⋅ 𝒓 𝒚𝒊 𝒊 𝒓 𝒙𝒊 𝟐 ⋅ 𝒊 𝒓 𝒚𝒊 𝟐 Intuitively we want: sim(A, B) > sim(A, C) Jaccard similarity: 1/5 < 2/4 Cosine similarity: 0.386 > 0.322 Considers missing ratings as “negative” Solution: subtract the (row) mean sim A,B vs. A,C: 0.092 > -0.559 Notice cosine sim. is correlation when data is centered at 0

Rating Predictions From similarity metric to recommendations: Let rx be the vector of user x’s ratings Let N be the set of k users most similar to x who have rated item i Prediction for item s of user x: 𝑟 𝑥𝑖 = 1 𝑘 𝑦∈𝑁 𝑟 𝑦𝑖 𝑟 𝑥𝑖 = 𝑦∈𝑁 𝑠 𝑥𝑦 ⋅ 𝑟 𝑦𝑖 𝑦∈𝑁 𝑠 𝑥𝑦 Other options? Many other tricks possible… Shorthand: 𝒔 𝒙𝒚 =𝒔𝒊𝒎 𝒙,𝒚

Item-Item Collaborative Filtering 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 sij… similarity of items i and j rxj…rating of user u on item j N(i;x)… set items rated by x similar to i

Item-Item CF (|N|=2) users 12 11 10 9 8 7 6 5 4 3 2 1 movies - unknown rating - rating between 1 to 5

Item-Item CF (|N|=2) users 12 11 10 9 8 7 6 5 4 3 2 1 ? movies - estimate rating of movie 1 by user 5

Item-Item CF (|N|=2) users 12 11 10 9 8 7 6 5 4 3 2 1 ? sim(1,m) 1.00 -0.18 0.41 -0.10 -0.31 0.59 movies Here we use Pearson correlation as similarity: 1) Subtract mean rating mi from each movie i 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] 2) Compute cosine similarities between rows Neighbor selection: Identify movies similar to movie 1, rated by user 5

Item-Item CF (|N|=2) users 12 11 10 9 8 7 6 5 4 3 2 1 ? sim(1,m) 1.00 -0.18 0.41 -0.10 -0.31 0.59 movies Compute similarity weights: s1,3=0.41, s1,6=0.59

Item-Item CF (|N|=2) users 12 11 10 9 8 7 6 5 4 3 2 1 movies 2.6 movies Predict by taking weighted average: r1.5 = (0.41*2 + 0.59*3) / (0.41+0.59) = 2.6 𝒓 𝒊𝒙 = 𝒋∈𝑵(𝒊;𝒙) 𝒔 𝒊𝒋 ⋅ 𝒓 𝒋𝒙 ∑ 𝒔 𝒊𝒋

Item-Item vs. User-User Avatar LOTR Matrix Pirates Alice Bob Carol David There is a difference in the typical behavior of users and items, as it pertains to similarity. Intuitively, items tend to be classifiable in simple terms. For example, music tends to belong to a single genre. It is impossi- ble, e.g., for a piece of music to be both 60’s rock and 1700’s baroque. On the other hand, there are individuals who like both 60’s rock and 1700’s baroque, and who buy examples of both types of music. The consequence is that it is easier to discover items that are similar because they belong to the same genre, than it is to detect that two users are similar because they prefer one genre in common, while each also likes some genres that the other doesn’t care for. In practice, it has been observed that item-item often works better than user-user Why? Items are simpler, users have multiple tastes

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

Hybrid Methods Implement two or more different recommenders and combine predictions Perhaps using a linear model Global baseline + collaborative filtering Add content-based methods to collaborative filtering Item profiles for new item problem Demographics to deal with new user problem

Global baseline estimate Estimate Joe’s rating for the movie The Sixth Sense No feature selection needed Problem: Joe has not rated any movie similar to The Sixth Sense Global baseline estimate Mean movie rating: 3.7 stars The Six Sense is 0.5 stars above avg Joe rates 0.2 stars below avg Baseline estimate: 3.7 + 0.5 – 0.2 = 4 stars

Combining Global Baseline with CF Global baseline estimate Joe with give The Six Sense is 4 stars Local neighborhood (CF/NN) Joe didn’t like movie Signs Rate 1 star below his average rating Final estimate Joe will rate The Sixth Sense 3 stars

Global Baseline Estimate Define similarity sij of items i and j Select k nearest neighbors N(i; x) Items most similar to i, that were rated by x Estimate rating rxi as the weighted average: baseline estimate for rxi μ = overall mean movie rating bx = rating deviation of user x = (avg. rating of user x) – μ bi = rating deviation of movie i 𝒃 𝒙𝒊 =𝝁+ 𝒃 𝒙 + 𝒃 𝒊

baseline estimate for rxi Before: CF: Common Practice Define similarity sij of items i and j Select k nearest neighbors N(i; x) Items most similar to i, that were rated by x Estimate rating rxi as the weighted average: baseline estimate for rxi μ = overall mean movie rating bx = rating deviation of user x = (avg. rating of user x) – μ bi = rating deviation of movie i 𝒃 𝒙𝒊 =𝝁+ 𝒃 𝒙 + 𝒃 𝒊

Item-Item CF (|N|=2) users 12 11 10 9 8 7 6 5 4 3 2 1 movies 2.6 movies Predict by taking weighted average: r1.5 = (0.41*2 + 0.59*3) / (0.41+0.59) = 2.6 𝒓 𝒊𝒙 = 𝒋∈𝑵(𝒊;𝒙) 𝒔 𝒊𝒋 ⋅ 𝒓 𝒋𝒙 ∑ 𝒔 𝒊𝒋

Remarks & Practical Tips - Evaluation - Error metrics - Complexity / Speed

Evaluation movies 1 3 4 5 2 users

Evaluation movies 1 3 4 5 2 ? users Test Data Set

Evaluating Predictions Compare predictions with known ratings Root-mean-square error (RMSE) 𝑥𝑖 𝑟 𝑥𝑖 − 𝑟 𝑥𝑖 ∗ 2 where 𝒓𝒙𝒊 is predicted, 𝒓 𝒙𝒊 ∗ is the true rating of x on i Precision at top 10: % of those in top 10 Rank Correlation: Spearman’s correlation between system’s and user’s complete rankings

Problems with Error Measures Narrow focus on accuracy sometimes misses the point Prediction Diversity Prediction Context Order of predictions In practice, we care only to predict high ratings: RMSE might penalize a method that does well for high ratings and badly for others

Collaborative Filtering: Complexity Expensive step is finding k most similar customers: O(|X|) Too expensive to do at runtime Could pre-compute Naïve pre-computation takes time O(k ·|X|) X … set of customers We already know how to do this! Near-neighbor search in high dimensions (LSH) Clustering Dimensionality reduction

Pre-processing for item-based filtering Item-based filtering does not solve the scalability problem itself Pre-processing approach by Amazon.com (in 2003) Calculate all pair-wise item similarities in advance The neighborhood to be used at run-time is typically rather small, because only items are taken into account which the user has rated Item similarities are supposed to be more stable than user similarities Memory requirements Up to N2 pair-wise similarities to be memorized (N = number of items) in theory In practice, this is significantly lower (items with no co-ratings) Further reductions possible Minimum threshold for co-ratings Limit the neighborhood size (might affect recommendation accuracy)

Tip: Add Data Leverage all the data Add more data Don’t try to reduce data size in an effort to make fancy algorithms work Simple methods on large data do best Add more data e.g., add IMDB data on genres More data beats better algorithms http://anand.typepad.com/datawocky/2008/03/more-data-usual.html

Homework 9.3.1 9.2.3