2 Implementing a simple recommender model
The chapter emphasizes that recommender systems should begin with simple, understandable solutions rather than complex models that are hard to debug and deploy. It introduces popularity-based recommendations as a reliable fallback that guarantees the system always has something to show, provides a baseline for comparison, and helps reveal important properties of the data. The broader message is that starting simple improves robustness, observability, and learning before moving to more advanced techniques.
It then builds a collaborative filtering recommender using MovieLens data, treating ratings as interactions and representing users and items in a sparse user-item matrix. By computing item-item cosine similarity, the system retrieves candidate movies that are frequently watched by similar users, filters out items the user has already seen, adds a popularity signal, and ranks candidates with a weighted score. This is framed as a four-stage pipeline: retrieval, filtering, scoring, and ranking, which makes the recommender modular and easier to test, tune, and reuse.
The chapter also shows how content-based recommendation fits the same framework by replacing behavioral similarity with TF-IDF vectors built from movie titles and genres. This approach works immediately for new items, helping address the cold start problem, but its usefulness depends heavily on metadata quality and richness. Finally, the chapter combines behavioral, content, and popularity signals into a hybrid recommender, highlighting the tradeoff between accuracy and complexity and reinforcing the idea that the same pipeline can support many recommendation strategies.
illustrates the process of starting with a complex solution, failing to make it work in the test environment, and then attempting to deploy it in production, only to fail again. Replacing it with something that also doesn’t work will result in the loss of resources, opportunities, and eventually jobs.
A fallback can be as simple as a batch job that runs every hour to create a list of content items ranked by popularity.
Creating an item-item similarity matrix, based on what users have watched.
illustrates how the ranking of items changes depending on the relative weight of similarity versus popularity.
The four-stage pipeline for Netflix's "Popular on Netflix" carousel. Starting with all popular content, the system filters, scores, and orders to create
The bump chart shows an example of how one user's taste changes the order of the popular items. Pulp Fiction is removed completely as it's a movie the user has already seen. There are many ways to tweak this.
Two books can be similar in many ways.
Summary
- The four-stage framework separates recommendations into retrieval (generate candidates quickly), filtering (apply business rules), scoring (compute detailed relevance), and ordering (rank for presentation). This structure appears across modern recommender systems and remains constant throughout this book.
- We built the framework by example. Starting with ItemKNN, we saw how each stage naturally emerged from practical needs rather than from abstract design.
- Collaborative filtering uses user behavior to find similar items. It discovers patterns that metadata can't capture, but struggles with new items that lack interaction data.
- Content-based recommendations use item metadata to find similar items. They handle new items immediately but are limited by metadata quality — as we saw when genre-only vectors couldn't distinguish meaningfully between very different films.
- Hybrid approaches combine both signals in retrieval and let the ranker weight them. Items that score well across multiple signals rise to the top.
- The "Popular for You" pattern starts with popular items and then reranks them by user similarity, demonstrating how the same four-stage framework can support very different recommendation strategies.
- A fallback recommender — typically a popularity-based list — ensures the system always has something to show, even when models fail, or users have no history.
- Start simple. Popularity and ItemKNN are surprisingly effective. Add complexity only where evaluation shows clear improvement.
AI Recommender Systems ebook for free