Lion Cipher Lab
Build a recommender system
- AI Security
- Beginner
- ~40 min
- Free · no account required
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
- understanding what a recommender is
- the intuition behind collaborative filtering
- building a user-item ratings matrix in pandas
- computing item-item cosine similarity with scikit-learn
- generating top-N recommendations for a user
- reading recommendations qualitatively to sanity-check them
- naming the cold-start problem, popularity bias, and filter bubbles
- thinking about how recommenders shape behavior
Steps in this lab
- What a recommender is, and the collaborative-filtering idea
- Install numpy, pandas, and scikit-learn
- Build a tiny ratings matrix by hand
- Cosine similarity, the measurement that powers it
- Compute item-item cosine similarity
- Recommend the top-N items for a user
- The honest limits: cold-start, popularity bias, filter bubbles
- What you built, and the responsibility that comes with it