Polimi · 2024/25

Recommender Systems

From completing a giant, mostly-empty interaction matrix to neighbourhood models, matrix factorization, learning-to-rank and graph neural recommenders — the full Politecnico di Milano Recommender Systems course, rebuilt as an interactive, exam-focused study guide.

15 chapters~15 h reading 37 past-exam questions

Practice past exams 37 questions from 2020–2026 papers — filter by chapter, year and difficulty, with instant grading and worked solutions.

After this course you can

  • Read a URM and ICM correctly - including why a 0 means unknown, not disliked - and pick the algorithm family each feeds
  • Evaluate recommenders with ranking metrics and design a split free of information leakage
  • Compute content-based and collaborative similarities and predict with a K-nearest-neighbour average
  • Derive and apply the learned models: SLIM, BPR and matrix factorization
  • Build graph-based recommenders from the bipartite adjacency and explain their popularity bias
  • Measure and mitigate exposure bias with the Gini coefficient, MMR re-ranking and KL calibration

Syllabus

  1. Foundations & the Data Model

    Recommender systems are, at their core, the problem of completing a giant, mostly-empty table. Before any algorithm you must agree on what goes in the cells, what the holes mean, and where the numbers come from — the URM, the ICM, explicit vs implicit feedback, and the sparsity that defines the field.

    high exam weight. 50 minutes reading. 3 past-exam questions.
  2. Non-Personalized Recommendation

    Before we know anything about you, what should we recommend? Whatever the crowd likes. Top-Popular, Best-Rated, shrinkage and Global Effects — the trivial-to-build baselines every personalized model must beat, and the bias terms that become the backbone of matrix factorization.

    40 minutes reading.
  3. Evaluating Recommenders

    Every chapter after this proposes an algorithm; this is the one that decides whether any of them work. What "good" means, how to split data without cheating, and the three metric families — error, classification and ranking — that turn a recommendation list into a single number.

    high exam weight. 60 minutes reading. 6 past-exam questions.
  4. Content-Based Filtering

    The first personalized recommender — if you liked an item, you will like items that look like it. Content-based filtering lives entirely in the ICM: normalise the rows, build an item–item similarity matrix, sparsify it with KNN, and score new items by a similarity-weighted sum of your own ratings.

    low exam weight. 55 minutes reading. 2 past-exam questions.
  5. Collaborative Filtering (Neighborhood)

    Throw the item descriptions away and listen to behaviour: people who agreed in the past will agree in the future. The only input is the URM — and it reuses the exact cosine + KNN machinery from content-based filtering, pointed at the rating matrix. User-based vs item-based, Pearson, and memory vs model.

    high exam weight. 60 minutes reading. 4 past-exam questions.
  6. SLIM

    Chapter 5 left one question hanging: which similarity should the item–item matrix use? SLIM stops choosing and starts learning. It keeps item-based CF's prediction r̂ = R·S exactly, but treats every entry of S as a parameter and fits it so R·S reconstructs the rating matrix from itself — with two constraints and ElasticNet regularization.

    low exam weight. 65 minutes reading. 2 past-exam questions.
  7. BPR & Learning-to-Rank

    SLIM learned S by minimising a rating error — but we never serve ratings, we serve a ranked list. Bayesian Personalized Ranking changes the objective: from implicit feedback it builds pairs (a thing you clicked vs a thing you didn't) and trains so the clicked item scores higher. The loss is pairwise, and minimising it maximises the AUC.

    medium exam weight. 65 minutes reading. 2 past-exam questions.
  8. Matrix Factorization

    Content-based filtering needed someone to tag every item; collaborative filtering threw the tags away. Matrix factorization invents the attributes — it assumes a handful of hidden latent features explain every rating, learns them from the URM, and makes a prediction a dot product. The rating matrix becomes a product of two skinny matrices.

    low exam weight. 70 minutes reading. 2 past-exam questions.
  9. Hybrid Recommenders

    Every algorithm so far has a blind spot: content-based handles new items but can't sense taste communities; collaborative leverages behaviour but is helpless against a brand-new item. A hybrid marries them — combining their opinions at the score level, the list level, the model level, or by training them jointly so each compensates for the other's weakness.

    low exam weight. 55 minutes reading. 2 past-exam questions.
  10. Graph-Based Recommenders

    Every recommender so far worked on matrices. A graph-based recommender redraws the problem: users and items become nodes, ratings become edges, and a recommendation is a random walk — start at a user, follow edges to items, to users, back to items, and rank where you land. The famous P³ method does this in three hops and reveals that item-based CF is a degree-normalised walk.

    high exam weight. 65 minutes reading. 4 past-exam questions.
  11. Deep Learning for RecSys

    KNN, SLIM and MF are linear at heart. Deep learning adds stacked non-linear layers that learn their own features. Three architectures dominate: the autoencoder (compress a profile, reconstruct it, read off the blanks), the two-tower model (one tower per side, joined at a dot product), and the variational autoencoder. Strip the non-linearities and a shallow autoencoder collapses to a factorised item–item similarity — MF and item-CF are special cases.

    high exam weight. 65 minutes reading. 5 past-exam questions.
  12. Factorization Machines

    MF sees only users and items; linear regression sees any feature but only linearly. Factorization Machines do both: they accept arbitrary one-hot feature vectors (users, items, genres, context) and learn factorised pairwise interactions between every feature pair. Instead of a dense O(n²) weight matrix W, FM sets W ≈ VVᵀ — one latent vector per feature — unifying global effects, MF, hybrid, and context-aware recommenders in a single equation.

    medium exam weight. 58 minutes reading. 3 past-exam questions.
  13. Graph Convolutional Networks

    MF learns embeddings from ratings alone; graph methods walk the interaction graph. GCNs merge the two — they learn user and item embeddings *on* the graph, where each node's embedding aggregates its neighbours' (message passing). Stack hops and an embedding absorbs information from items several hops away. LightGCN, the simplest effective GCN, is just weighted-mean aggregation with BPR — and the fact that it works so well is both the beauty and the warning of the approach.

    medium exam weight. 62 minutes reading. 2 past-exam questions.
  14. Ethics & Fairness

    Accuracy is not enough. A recommender that maximises click-through can also concentrate attention on a few items, trap users in filter bubbles, under-serve minorities, or push toward extreme content. This chapter asks how to *measure* these harms — the Gini coefficient for concentration, KL calibration for genre balance — and how to *fix* them — MMR and popularity-aware re-ranking — with case studies from Spotify and Facebook on how real systems face the trade-offs.

    52 minutes reading.
  15. Beyond Collaborative Filtering

    Collaborative filtering asks: given who you are and what you've rated, what else would you like? The real world asks harder questions — what if you're a first-time visitor, or your taste depends on whether it's Saturday night, or the order of your clicks matters more than which ones? This closing chapter maps four families beyond the URM: context-aware (tensor factorisation), session-based, knowledge-based, and sequence-aware (RNN/Transformer).

    48 minutes reading.