Recommendations with Alternating Least Squares

hard
Unit 22 · Bayesian0/0 to milestone

Collaborative filtering approximates a sparse user × item rating matrix as R≈UV⊤R \approx U V^\top with k latent factors. ALS alternates: fix V and solve a ridge regression for each user, then fix U and solve for each item.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Recommendations with Alternating Least Squares · TechGradify