A recommender system connects two kinds of entities:
Clean signal, but rare
Abundant, but noisier
The rating matrix $X \in \{\mathbb{R} \cup \, ?\}^{m \times n}$ stores users' explicit feedback:
The idea is to approximate $X$ with two tall, thin matrices:
In machine learning terms, we would like to find:
Finding the best rank-$d$ approximation of $X$ is equivalent to solving:
$$\min_{\operatorname{rank}(Y) \leq d} \|X-Y\|_{\operatorname{Fro}}^2$$
Suppose only three entries of $X \in \mathbb{R}^{2\times 2}$ are observed: $\;X = \begin{pmatrix} 1 & 3 \\ 2 & \color{#D50032}{?} \end{pmatrix}$
In a recommender, we observe only very few ratings.
We want to minimise
$$\mathcal{L}(U,V) = \sum_{(i,j) \in \Omega} \big(X_{ij} - \mathbf{u}_i^\top \mathbf{v}_j\big)^2 + \lambda \big( \|U\|_{\operatorname{Fro}}^2 + \|V\|_{\operatorname{Fro}}^2 \big)$$
Idea: never optimise $U$ and $V$ at the same time. Fix one, update the other, and alternate.
With $V$ fixed, user $i$'s observed ratings depend only on $\mathbf{u}_i$: a small linear system.
$$\hat{\mathbf{u}}_{\text{Diana}} = \big(V_{\Omega^{\text{Diana}}}^\top V_{\Omega^{\text{Diana}}} + \lambda I_d\big)^{-1} V_{\Omega^{\text{Diana}}}^\top X_{\Omega^{\text{Diana}}} \approx \begin{pmatrix} 2.20 \\ -0.19 \end{pmatrix}, \qquad \lambda = 0.1$$
Its dot products fit her ratings ($3.88 \approx 4$, $-0.74 \approx -0.75$) and predict Casablanca $\approx 5.08$.
In practice, we observe far more implicit than explicit feedback.
Split the interaction matrix $X$ into two matrices.
$$\mathcal{L}_i(\mathbf{u}_i) = \sum_{j=1}^{n} \Big(\sqrt{\textcolor{#6a3d9a}{C_{ij}}}\,\big(\textcolor{#2e7d32}{P_{ij}} - \textcolor{#1f5fbf}{\mathbf{v}_j^\top} \mathbf{u}_i\big)\Big)^2 + \lambda \|\mathbf{u}_i\|_2^2$$
Once $U$ and $V$ are learned, score every item $j$ for user $i$: $\hat{X}_{ij} = \mathbf{u}_i^\top \mathbf{v}_j$, that is, $\mathbf{s}_i = V \mathbf{u}_i$.