Loading...
Loading...
Linear Algebra for Machine Learning · Axiom Academy
Using SVD for Netflix/Spotify-Style Recommendations Netflix has millions of users and thousands of movies. Each user has rated only a tiny fraction of movies (sparse data). The challenge: predict ratings for unwatched movies to recommend them. Key insight: If users with similar tastes rate movies similarly, maybe we can find hidden "latent factors" (like "action content," "emotional depth," "romance") that explain preferences. Represent this as a user-item matrix R where R[i,j] = rating of user i for movie j: Most entries are missing (sparse matrix). We want to fill in the missing ratings. SVD Solution: Factor Decomposition Compute SVD of R (or impute missing values first): The truncated SVD with k latent factors gives us: U_k: User latent factors (how each user relates to latent features) Σ_k: Importance of each latent factor V_k^T: Movie latent factors (how each movie relates to latent features) Fill missing ratings with the mean rating for each user or movie. This makes the matrix dense enough for SVD to work reliably. R ≈ U_k Σ_k V_k^T where k ≈ 10-50 latent factors (not thousands of movies). For user i and movie j: rating[i,j] ≈ (U_k Σ_k V_k^T)[i,j] = U_k[i,:] · Σ_k · V_k[j,:]^T Sort predicted ratings for unwatched movies and recommend the highest-rated ones. Latent factors representation: Instead of dealing with all movies directly, we work with k abstract features:
This is the written version of the interactive lesson above. See the full Linear Algebra for Machine Learning course.