From ratings to retrieval: a beginner-friendly book on recommender systems, with code that actually runs
I wrote the book I kept wishing existed: a beginner-friendly guide to how recommender systems actually work, from the first rating matrix to the retrieval systems that serve billions of requests — with Python code in every chapter that you can run yourself.
Recommender Systems: From Ratings to Retrieval is 13 chapters and about 142 pages, and it is built on one rule: nothing hand-waved. Every chapter's code was executed end-to-end against the real MovieLens-100K dataset, and every number printed in the book was produced by running that code. When the text reports a metric, that is the measured number, not a guess.
The goal is understanding, not API-calling. Each concept is built from scratch with intuition before math, starting from what a recommender even is and ending with the systems that decide what billions of people see.
What's inside#
- Part I — Foundations: what recommenders are, how to frame the problem, and how to evaluate them honestly — RMSE, precision@k, NDCG, and why offline metrics lie.
- Part II — Classical methods: content-based filtering, nearest neighbors, matrix factorization and SVD, implicit feedback, and hybrid models with LightFM.
- Part III — Ranking & deep learning: learning to rank, two-tower retrieval in PyTorch, and ANN search with FAISS.
- Part IV — Frontiers & production: sequential recommenders with SASRec, graphs, LLMs in the recommendation loop, and what it takes to ship one.
Every chapter has learning objectives, exercises, and key terms. The libraries are the open-source stack the field actually uses — scikit-surprise, implicit, lightfm-next, Cornac, PyTorch, FAISS — verified current as of September 2026. No GPU needed; everything runs on a laptop CPU.
The code is free#
The full companion repository is on GitHub, MIT-licensed: github.com/yahyusl/recsys-book-code. Chapter-by-chapter scripts, a README, a requirements file, and a data-download script — run each one as you read.
Pricing, and what's available now#
The ebook will be $29 (PDF + ePub, free lifetime updates), $49 with the complete code package, and $99 for a team license covering up to 10 people. A Kindle edition at $12.99 follows on Amazon.
Direct sales are not open yet — they are coming soon. What you can get today, free: the full details page, the free sample PDF (the preface plus chapters 1–2), and the code on GitHub.