Lion Cipher Lab

Build a recommender system

Why it matters

A recommender is the piece of software deciding what shows up in your feed, your shopping suggestions, your next autoplay. Most people experience these systems only from the outside, where they feel like an all-knowing algorithm reading their mind. They are not mind-reading: the most common approach is a short chain of arithmetic over a table of who liked what. Building a tiny one yourself, by hand, on data you made up, dissolves the mystery in about forty minutes. It also puts you face to face with the responsibilities that come with these systems the moment they scale. A recommender that…

What you'll learn

Steps in this lab

  1. What a recommender is, and the collaborative-filtering idea
  2. Install numpy, pandas, and scikit-learn
  3. Build a tiny ratings matrix by hand
  4. Cosine similarity, the measurement that powers it
  5. Compute item-item cosine similarity
  6. Recommend the top-N items for a user
  7. The honest limits: cold-start, popularity bias, filter bubbles
  8. What you built, and the responsibility that comes with it

Open the full interactive lab →