Matrix Factorization for Movie Recommendations in Python
matrix-factorizationsvdrecommender-systemsmovielenspython
Abstraction: Low-rank SVD matrix factorization for collaborative filtering movie recommendations
Key points:
- Decomposes user-movie ratings matrix R into U Σ V^T (SVD); U encodes user-feature affinity, V^T encodes movie-feature affinity
- Low-rank approximation with k=50 latent factors; neighborhood methods overfit sparse raw data and fail to capture latent preferences
- Limitation of neighborhood methods illustrated: two users with no overlapping RHCP songs get dot-product 0 despite similar taste
- De-means ratings by user mean before factorization; uses
scipy.sparse.linalg.svdsto directly compute rank-k approximation - For movies, k between 20–100 generalizes best to unseen data; higher k overfits training ratings
- Probabilistic matrix factorization and hybrid neighborhood+factorization models outperform pure SVD in production
Connections: Movielens · Matrix Factorization · Singular Value Decomposition · Collaborative Filtering · Recommender Systems
Source: https://beckernick.github.io/matrix-factorization-recommender/