Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Computing an SVD | Deep Personalization through Matrix Factorization
Market Basket Analysis and Recommendation Systems
Section 4. Chapter 3
single

single

Challenge: Computing an SVD

Swipe to show menu

Task

Swipe to start coding

Singular Value Decomposition (SVD) is a matrix factorization technique used in recommendation systems to analyze and compress large, sparse user-item matrices. By factorizing a matrix A into three matrices U, Sigma, and V^T, SVD reveals hidden patterns and relationships. You can approximate the original matrix by keeping only the top k singular values and corresponding vectors, which captures the most significant information and reduces noise.

Your task is to implement a function compute_svd_recommendation that:

  • Takes as input a user-item ratings matrix (2D numpy array) and an integer k (number of latent factors);
  • Factorizes the matrix using SVD into (U), Sigma, and V^T;
  • Constructs a rank-k approximation of the original matrix using only the top k singular values and vectors;
  • Returns the reconstructed matrix (as a numpy array) that can be used for making recommendations.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 3
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt