2
$\begingroup$

How do we use spark MLLIB ALS (alternating least squares) to recommend products to users? Basically we need to give ratings to products which are not rated by user. Example given is with ratings what if rating is "NA"- "not applicable"?

$\endgroup$
  • $\begingroup$ I'm not sure about what do you mean by not applicable. Would you care explaining your use case ? I think that I might be able to help you with more information. $\endgroup$ – eliasah Jul 2 '16 at 11:55
0
$\begingroup$

Matrix factorization methods for recommender systems decompose large user-item matrix into lower dimensional user factors $p_u$ and item factors $q_i$. You can estimate the user rating by taking the inner product $r_{ui} = p_u^{T}q_i$. So if you have NaNs present in your rating data you can fill the NaNs with zeros.

There is an excellent tutorial on how to apply Alternating Least Squares (ALS) to a recommender problem using the MovieLens dataset. The training RDD consists of (userId, movieId, rating) tuple. Once new user movie ratings are added the model is retrained and generates new user ratings for all movies.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.