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, :]
Do the values of matrix
A_krepresent 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?