In matrix factorisation for recommendation, a rating is modelled as with user vector and item vector . With squared loss plus L2 penalty , learning rate and , perform one stochastic gradient step on this rating. What are the new , and prediction?
Unsupervised learning, Matrix factorisation
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can derive and apply the SGD update for latent-factor models, remembering that both factors are updated from the old values.
Key idea
For loss , with error : and .
Steps
- Prediction: , so the error is .
- The gradient of the loss with respect to is , and with respect to it is . A step against the gradient gives the update rules in the key idea.
- Update using the old : and .
- Update using the old (not the new one): and .
- New prediction: , closer to the target than was.
Common mistakes
- Updating first and then using the new to update . Both gradients are evaluated at the same point.
- Applying the regulariser with the wrong sign, which would make the vectors grow.
- Forgetting that only the rated entries contribute to the loss. Missing entries are not treated as zeros.
How long your answer should be
Half a page; 4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Unsupervised learning: Four 2-D points are , , and . What are the sample covariance matrix, the first principal component, the fraction of variance it explains, and the coordinate of the first point along it?
Next in Unsupervised learning: A Gaussian kernel density estimate with bandwidth is built from the three 1-D points , and . (a) Write and compute for . (b) What does become for , and what does the change in do to the estimate in general?