Machine Learning
Supervised Learning: Classification / Recommendation Systems
7. Recommendation Systems
A Recommendation System predicts the preference or rating a user would give to an item. They are widely used in e-commerce (Amazon) and streaming (Netflix, Spotify).
1. Content-Based Filtering
Recommends items similar to those a user has liked in the past, based on item attributes (features).
Core Idea: "If you liked item A, and item B is similar to A, you will like item B."
How it works:
- Build an item profile (e.g., genre, director for movies).
- Build a user profile based on items they interacted with.
- Compute similarity using Cosine Similarity.
2. Collaborative Filtering
Recommends items based on the preferences and behaviors of similar users, without using item features.
Core Idea: "Users who liked the same items as you in the past will likely have similar tastes for new items."
User-Based CF Algorithm
- Find users similar to the active user using Pearson correlation or Cosine similarity on their rating vectors.
- Identify items liked by these similar users but not yet seen by the active user.
- Predict the rating for these unseen items by taking a weighted average of the similar users' ratings.
- Recommend the items with the highest predicted ratings.
Model-Based CF (Matrix Factorization)
Represents the user-item rating matrix as a product of two lower-dimensional matrices. R ≈ U × Vᵀ.
3. Hybrid Filtering
Combines both approaches to overcome individual limitations (like the cold-start problem). Examples include Netflix, which uses matrix factorization (collaborative) along with genre/cast features (content).