There's more...

People often struggle with ALS even though at its core it is a simple linear algebra operation with an added regularization penalty. What makes ALS powerful is its ability to be parallelized and to deal with scale (for example, Spotify).

ALS in layman's language involves the following:

  • With ALS, you basically want to factorize a large matrix of ratings X (100 million plus users is not a stretch at all) and user product ratings into two matrices of A and B, with lower ranks (see any introductory linear algebra book). The problem is that it often becomes a very hard non-linear optimization problem to solve. To remedy with ALS, you introduce a simple solution (A for Alternating) in which you fix one of the matrices and partially ...

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.