DS701 Session 22 — Wed Nov 18, 2026
In item–item collaborative filtering, how is a missing rating \(\hat r_{ui}\) predicted? Name the two ingredients (what is compared to what, and how the pieces are combined), and say why the ratings matrix being 99.97% empty is the central difficulty rather than a detail.
The lecture said we want “something like an SVD” of the ratings matrix but cannot use the SVD algorithm directly, and instead minimises \(\Vert (R - UV^T)_S \Vert^2 + \lambda(\Vert U\Vert^2 + \Vert V\Vert^2)\) by alternating least squares. Explain (a) why the SVD cannot be applied as-is, (b) what the subscript \(S\) does to the objective, and (c) why holding \(U\) fixed turns the problem into one you already know how to solve.
In Session 14 you took the SVD of a small ratings matrix with planted taste factors and saw users and items land in a shared latent space. Connect that to today: what does a row of \(U\) and a row of \(V\) mean* in the recommender’s factorization, how is a rating formed from them, and what can this shared space do that item–item CF cannot? Then name one situation in which neither CF nor MF has anything to say.*


Item–item: to guess \(r_{ui}\), look at items like \(i\) that \(u\) has rated, and average.
\[ \hat r_{ui} = \frac{\sum_{j \in n_k(i,u)} s_{ij}\, r_{uj}}{\sum_{j \in n_k(i,u)} s_{ij}} \qquad \frac{0.84\cdot 2 + 1.0\cdot 3}{0.84 + 1.0} = 2.54 \]
Some users rate everything high; some items are simply loved. Left in, that noise masquerades as similarity.
\[ b_{ui} = \mu + \alpha_u + \beta_i \qquad\text{(global mean, user offset, item offset)} \]
Compute similarity on the residuals \(r_{ui} - b_{ui}\), and add the bias back when predicting:
\[ \hat r_{ui} = b_{ui} + \frac{\sum_{j \in n_k(i,u)} s_{ij}\,(r_{uj} - b_{uj})}{\sum_{j \in n_k(i,u)} s_{ij}} \]
Two practicalities: estimate \(\mu, \alpha, \beta\) by alternating regularised least squares over the observed entries (fix two, solve the third); and keep only positively similar neighbours, or the denominator can collapse.
CF’s report card: no training, easy to update, explainable (“because you liked Blade Runner”) — but accuracy is limited and neighbour search does not scale.

CF uses item similarity or user similarity. MF puts both in one latent space:
Biconvex, not jointly convex: fix one factor and the objective is convex in the other.
Each half-step is a ridge regression per row, restricted to that row’s observed entries:
\[ \mathbf u_u = \big(V_{J_u}^\top V_{J_u} + \lambda I\big)^{-1} V_{J_u}^\top \mathbf r_{u, J_u} \]
\(J_u\) = the items user \(u\) rated, \(V_{J_u}\) = their factor rows. Every step lowers the objective → converges.
MF in practice (lifted from Recommender Systems II):

Everything on the previous slides needs a history.
Today’s report-out: a patron who has borrowed nothing — what each method predicts for her, why, and the cheapest thing that beats the global mean.
Goal: a public library’s e-media platform wants a “patrons who borrowed this also borrowed…” panel and a plan for brand-new patrons, but its borrowing records cannot leave the library — so you work on a simulator built to the library’s stated shape (80 patrons, 36 titles, planted genres and biases, 70% missing), where the truth is known. Part 1 measures the sparsity and scores two baselines on held-out ratings; Part 2 builds item–item CF by hand (adjusted-cosine similarity, \(k\)-NN prediction) so a librarian can see one recommendation computed; Part 3 implements ALS for matrix factorization, checks it beats the baselines on held-out ratings, and checks the learned factors recover the genres. The report-out answers the library’s second question from the lecture’s cold-start section: what to show a patron who has borrowed nothing.
numpy, pandas, matplotlib, scikit-learn.The activity notebook goes live on the day of the lecture. Colab is optional — you can also open it on GitHub and run it locally.
Full lecture notes: Recommender Systems