Rating matrix, 2D latent-factor plane, RMSE curves and a regularisation sweep for alternating least squares.
Checks that one ALS row update satisfies its normal equations, that J decreases monotonically over 25 sweeps, then sweeps lambda to show the held-out RMSE U-shape.
Not run yet.
The science
Model. A listener×track rating matrix R is only partly observed. Matrix factorization looks for low-rank factors so that rui ≈ pu·qi, with pu, qi in Rk. It minimises, over observed training cells only, J = Σ(rui − pu·qi)2 + λ(Σu nu|pu|2 + Σi ni|qi|2) (weighted-λ regularisation, n = number of ratings of that row or column).
ALS step. With all q fixed, each pu has a closed form: (QuTQu + λnuI) pu = QuTru, a k×k linear system solved by Gaussian elimination. Then qi are solved the same way with p fixed. Each half-step is an exact minimiser, so J never increases (the in-page check verifies this and the normal-equation residual).
Reading the picture. Left: the rating matrix (rows sorted by listener taste group, columns by genre); switch between observed, fully predicted and error views; white-outlined cells are held-out test ratings the model never saw. Right: the latent plane, the top two principal directions of all pu (circles) and qi (squares); a listener points toward tracks they will rate high. Click a circle to select a listener.
Regularisation. Train RMSE keeps falling with larger k and smaller λ, but held-out RMSE has a U-shape: too little λ overfits sparse rows, too much shrinks all predictions to zero. The experiment sweeps λ and plots both curves.
Honest simplifications. Synthetic data with a hidden rank-4 structure (not real listening logs), explicit star ratings rather than implicit plays, no bias terms or mean-centering, a single random split (about 15% held out), so sweep values carry sampling noise. Same generator and ALS-WR algorithm as the 3D page.