SVD for recommendation engine I'm trying to build a toy recommendation engine to wrap my mind around Singular Value Decomposition (SVD). I've read enough content to understand the motivations and intuition behind the actual decomposition of the matrix A (a user x movie matrix).

I need to know more about what goes on after that. 

from numpy.linalg import svd
import numpy as np

A = np.matrix([ 
  [0, 0, 0, 4, 5],
  [0, 4, 3, 0, 0],
  ...
])
U, S, V = svd(A)

k = 5 #dimension reduction
A_k = U[:, :k] * np.diag(S[:k]) * V[:k, :]


Three Questions:


Do the values of matrix A_k represent the the predicted/approximate ratings?
What role/ what steps does cosine similarity play in the recommendation?
And finally I'm using Mean Absolute Error (MAE) to calculate my error. But what I'm values am I comparing? Something like MAE(A, A_k) or something else?
You can use SVD to build a recommendation engine, but I don't think it's the best way to get intuition around what's going on under the hood. Regardless, here's a presentation with more details, I'd recommend reviewing slide 9.

And to answer your questions:


A_k represents an embedding dimension (i.e. the low-rank approximation) that is used to predict the user-rating matrix.
The cosine similarity is just the dot product for user $i$ and item $j$, which maps to the predicted rating for user $i$ and item $j$. The dot product is what defines the users and items as being similar. 
Yes, you should use the MAE on A and A_k. You may prefer to use MSE instead. This measures the quality of your predictions for user $i$ and item $j$. Note, this is obviously the MSE of a matrix, which is the Frobenius Norm.


I think an easier way to understand SVD is to see it applied to image compression for different components. See this presentation here.