Recommender Systems
Recommender systems suggest items to users based on historical interaction patterns and profile attributes.
Collaborative Filtering
Collaborative filtering recommends items based on the behavior of similar users.
Cosine Similarity
We measure the similarity between user rating vectors and via:
Predictions are weighted averages of ratings from similar users.
Matrix Factorization (Latent Factor Models)
Matrix Factorization decomposes the sparse user-item rating matrix of shape into two lower-rank matrices: of shape and of shape , representing user and item latent factor embeddings:
We find matrices and by minimizing the squared error over observed ratings, applying regularization to prevent overfitting:
where is the set of user-item pairs with observed ratings, is the global average rating, and are user and item bias parameters. Biases isolate systematic offsets (e.g., users who always rate critically, or items that are universally liked).
Cold Start Problem
Latent factor models struggle when a new user or item joins because interaction data is missing. Hybrid systems mitigate this by utilizing content metadata (e.g., genre, age).
Example: Computing Embedding Similarity
The following example demonstrates calculating the cosine similarity between item latent embeddings:
Interactive Lab
Calculate the cosine similarity between item latent factor vectors (embeddings) to evaluate collaborative recommendation links.
Exercise
Test your understanding of matrix factorization limits:
Why are biases (user bias and item bias) typically added to the prediction formula in Matrix Factorization?
Regularization
The L2 regularizer parameter prevents user/item embedding parameters from growing too large during updates, mitigating overfitting.