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.
- Book: Recommender Systems: From Ratings to Retrieval — 13 chapters, about 142 pages.
- Verified code: every chapter's code was executed end-to-end against the real MovieLens-100K dataset; every printed metric is a measured number.
- Scope: rating matrices and evaluation (RMSE, precision@k, NDCG) through matrix factorization, two-tower retrieval in PyTorch, ANN search with FAISS, SASRec, and LLM-era frontiers.
- Stack: scikit-surprise, implicit, lightfm-next, Cornac, PyTorch, FAISS — verified current as of September 2026; no GPU needed, runs on a laptop CPU.
- Code: full companion repository free on GitHub (MIT): github.com/yahyusl/recsys-book-code.
- Pricing: ebook $29 (PDF + ePub, free lifetime updates), $49 with the complete code package, $99 team license (up to 10 people), Kindle $12.99 on Amazon; direct sales not open yet, but a free sample PDF (preface + chapters 1–2) is available now.
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.
Frequently asked questions
What makes this recommender-systems book different from other tutorials?
Its one rule: nothing hand-waved. Every chapter's code was executed end-to-end against the real MovieLens-100K dataset, so every metric printed in the book is a measured number, not a guess. Each concept is built from scratch with intuition before math, and every chapter has learning objectives, exercises, and key terms.
Do I need a GPU or prior experience to follow the book?
No GPU is needed — everything runs on a laptop CPU, using the open-source stack the field actually uses (scikit-surprise, implicit, lightfm-next, Cornac, PyTorch, FAISS). It is written for beginners, starting from what a recommender even is and building up to production retrieval systems.
Where can I get the book and the code?
The full companion code repository is free on GitHub under an MIT license at github.com/yahyusl/recsys-book-code, with chapter-by-chapter scripts, a README, a requirements file, and a data-download script. The ebook ($29) is not on direct sale yet, but a free sample PDF of the preface plus chapters 1–2 is available now; the Kindle edition ($12.99) follows on Amazon.