Skip to main content
Interactive 3D/Matrix Factorization for Recommendations
Click a grey cell to predict its rating
Matrix Factorization
Recommender: R ≈ U × Vᵀ. SGD finds latent factors.
Dimensions
Users8
Items10
Latent factors k4
SGD Params
Learning rate0.010
Regularization λ0.010
Sparsity55%
Actions
HUD
RMSE0.0000
Observed ratings31 / 80
Sparsity61.3%
Latent factors (k)4
SGD steps0
How It Works
The ratings matrix R (users × items) is factored as R ≈ U × Vᵀ where U captures user preferences and V captures item attributes in a k-dimensional latent space.

SGD minimizes the squared error on observed ratings plus L2 regularization on U and V.

Click a grey cell to compute the predicted rating: the dot product of that user's row in U and that item's column in V.

Matrix Factorization for Recommendations - Interactive Visualization

Matrix factorization decomposes a sparse user-item rating matrix R into two dense matrices: a user embedding matrix U and an item embedding matrix V, such that R ≈ U × V^T. Each row in U is a latent representation of a user's preferences; each row in V encodes an item's characteristics in the same latent space. The dot product of a user and item vector predicts the rating the user would give that item.

  • See the sparse rating matrix filled with known ratings and question marks for unknowns - the matrix completion problem
  • Watch SGD update user and item vectors step by step to minimize prediction error on observed ratings
  • Visualize the learned user and item vectors in 2D - similar users cluster together, similar items cluster together
  • Understand latent factors: you cannot name them, but dimensions often correlate with genre, style, or demographic preferences
  • Learn how the predicted rating for any user-item pair is simply the dot product of their respective learned vectors

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.