Techniqueintro
Content-based filtering
Also called content-based recommendation.
Recommends items whose features are similar to those of items the user liked before, from a profile of item features.
Content-based filtering recommends to a user the items whose features resemble those of the items the user liked before. Each item is described by features, such as genres, actors, words of a text or attributes of a product, and each user gets a profile built from the features of the items that the user rated or chose. Unlike collaborative filtering, it uses no data from other users, so it can recommend a new item as soon as its features are known.
In plain words
If you liked three detective novels, a content-based system looks at what these books have in common, such as the genre, the setting or the words that their descriptions use, and offers you more books with the same traits. It learns your taste as a list of traits that you like or dislike.
It needs a description of every item, and it never asks what other readers thought. So a brand new book can be recommended on its first day. But the system only finds more of what you already know, and it cannot guess that you would also enjoy something of a different kind.
When it applies
- Items have useful descriptions. Text, tags, categories or attributes that relate to taste: news articles, documents, jobs, recipes, products with specifications.
- New items arrive often. News and job offers are fresh every day and have no ratings yet.
- Few users, or private data. The profile of a user depends only on that user's own history.
- Explanations are needed. "Because you liked other films with this actor" follows directly from the profile.
- Not for new users. A user with no history still has no profile, see the cold-start problem.
The template
- Represent the items. Turn each item into a feature vector . For text, use the vector space model with tf-idf weights; for structured data, use one coordinate per attribute value.
- Collect the user's feedback. The items that the user rated, with their ratings, or the items the user chose, as positive examples.
- Build the profile. Either a vector in the same space, such as the sum of over the rated items, a form of the Rocchio algorithm for relevance feedback, or a classifier or regressor trained on the user's items alone, such as a naive Bayes classifier, logistic regression or linear regression.
- Score the unseen items. Use the cosine similarity of with the profile vector, or the output of the classifier.
- Rank and return the best , after removing the items that the user already knows.
Classic examples
Give the four items of the toy matrix of this group three features each, action, romance and comedy: , , and . User rated with 5, with 4 and with 1, with the mean .
| item | features | contribution to the profile | |
|---|---|---|---|
| (1, 1, 0) | 5/3 | (5/3, 5/3, 0) | |
| (1, 0, 0) | 2/3 | (2/3, 0, 0) | |
| (0, 1, 1) | (0, , ) |
The profile is : likes action and dislikes comedy, and romance is about neutral. The cosine of the profile with is , so is a good candidate. A new comedy that nobody has rated gets and is not recommended. No other user entered the computation, and needed no ratings.
Other examples are news filters that score articles by the words of the articles a reader opened, and the use of item text in the systems that Pazzani and Billsus (2007) review.
Variations
- Uncentered profiles. The mean of over the rated items, with the raw ratings in place of the centered ones, ignores dislikes, because every rating is positive. On the example it gives , a profile that likes all three genres.
- Classifiers per user. A naive Bayes classifier or a linear classifier per user predicts "liked" from the features.
- Learned item features. Features from embeddings of text or images, or topics from latent semantic analysis, in place of raw words.
- Knowledge-based recommendation. The user states the required attributes, and the system filters by rules; no history is needed.
- Combined with collaborative signals. See hybrid recommenders.
Pitfalls
- Overspecialization. The system recommends only items close to the profile, so the lists lack variety and surprise.
- Shallow features. Two films with the same genre and actors can differ in quality, which the features do not show.
- Feature work. Every item needs a description of the same kind, and building it can be costly.
- Raw text weights. Without tf-idf or a similar weighting, common words dominate the profile.
- Uncentered ratings. Ratings used as weights without centering make every rated item count as liked, as in the uncentered variation above.
Exercises
- On the example, add to the history of with the rating 4. Compute the new mean and profile. Hint: the mean becomes .
- Show that adding a constant to all ratings of a user does not change the centered profile.
- Give an example of two items with the same feature vector that users rate very differently. What can a content-based method predict for them?
- Explain why content-based filtering helps with a new item but not with a new user.
References
- Michael J. Pazzani and Daniel Billsus, Content-based recommendation systems, in The Adaptive Web, Lecture Notes in Computer Science 4321, Springer, 2007, 325-341, the representation of items by structured attributes and by free text with tf-idf weights, the user profile, the methods that learn it (decision trees and rules, nearest neighbors, relevance feedback and Rocchio's algorithm, linear classifiers, naive Bayes), and the limits of the approach
- Charu C. Aggarwal, Recommender Systems, The Textbook, Springer, 2016, Chapter 4 (content-based recommender systems)
- Yehuda Koren, Robert Bell and Chris Volinsky, Matrix factorization techniques for recommender systems, IEEE Computer 42(8), 30-37, 2009, section Recommender system strategies (content filtering, its need for external information, and its comparison with collaborative filtering)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 9TR7F8 Edit this page History Report an error Markdown