Recommender Systems
Collaborative filtering, content-based and two-tower retrieval models, plus the ranking metrics and feedback loops that make recommenders unusual.
Advanced · about 10 hours · difficulty 3/5
Learn first: Gradient Boosting with XGBoost and LightGBM, Evaluation Metrics, Perceptrons and Multilayer Networks
Recommenders decide what a user sees next: products, videos, jobs, songs. They drive a large share of revenue at many companies, so they are a common ML engineering specialty.
Approaches
- Popularity and heuristics: the baseline that is surprisingly hard to beat for new users.
- Content-based: recommend items similar to what the user liked, using item features or embeddings.
- Collaborative filtering: users who behaved alike will like similar things. Matrix factorization learns user and item vectors whose dot product predicts interest.
- Two-tower models: one network embeds users, another embeds items; nearest-neighbour search retrieves candidates quickly.
- Ranking models: gradient boosting or deep models rescore a few hundred candidates with rich features.
Data realities
Most data is implicit feedback (clicks, views, purchases) rather than ratings, and missing does not mean disliked. The cold-start problem hits new users and new items. Recommendations also shape future training data, creating feedback loops and popularity bias.
Evaluation
- Offline ranking metrics: precision@k, recall@k, MAP, NDCG, hit rate.
- Split by time, not at random, so you never train on the future.
- Beyond accuracy: coverage, diversity and novelty.
- The final judge is an online A/B test.
Good enough to move on when you can build a retrieval plus ranking recommender on a public dataset and evaluate it with NDCG@10 on a time-based split.
Key concepts
- Popularity baselines
- Content-based filtering
- Matrix factorization
- Implicit feedback
- Two-tower retrieval
- Candidate ranking stage
- NDCG and recall@k
- Cold start and feedback loops
Mini project
Using the MovieLens dataset, compare a popularity baseline, matrix factorization and a two-tower model on a time-based split with recall@20 and NDCG@10, and show recommendations for three sample users.
Check yourself
Why is a random train/test split misleading for recommender evaluation, and what does NDCG reward that precision@k does not?
Free resources
- Google: Recommendation Systems (Google)
- Dive into Deep Learning (d2l.ai)