# Recommender Systems

> Collaborative filtering, content-based and two-tower retrieval models, plus the ranking metrics and feedback loops that make recommenders unusual. Free notes,...

Canonical: https://www.internhack.in/roadmaps/tracks/machine-learning/recommender-systems
Last updated: 2026-11-28

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](https://www.internhack.in/roadmaps/tracks/machine-learning/gradient-boosting), [Evaluation Metrics](https://www.internhack.in/roadmaps/tracks/machine-learning/evaluation-metrics), [Perceptrons and Multilayer Networks](https://www.internhack.in/roadmaps/tracks/machine-learning/neural-networks-basics)

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](https://developers.google.com/machine-learning/recommendation) (Google)
- [Dive into Deep Learning](https://d2l.ai/) (d2l.ai)

Previous: [Diffusion Models](https://www.internhack.in/roadmaps/tracks/machine-learning/diffusion-models) · Next: [Time Series Forecasting](https://www.internhack.in/roadmaps/tracks/machine-learning/time-series-forecasting)

## More in Recommenders, Time Series and Reinforcement Learning

- [Recommender Systems](https://www.internhack.in/roadmaps/tracks/machine-learning/recommender-systems)
- [Time Series Forecasting](https://www.internhack.in/roadmaps/tracks/machine-learning/time-series-forecasting)
- [Reinforcement Learning Fundamentals](https://www.internhack.in/roadmaps/tracks/machine-learning/reinforcement-learning-basics)
- [Deep Reinforcement Learning](https://www.internhack.in/roadmaps/tracks/machine-learning/deep-reinforcement-learning)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Machine Learning Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/machine-learning)
