Run ALS with the configured parameters on an input RDD of (user, product, rating) triples.
Run ALS with the configured parameters on an input RDD of (user, product, rating) triples. Returns a MatrixFactorizationModel with feature vectors for each user and product.
Set the number of blocks to parallelize the computation into; pass -1 for an auto-configured number of blocks.
Set the number of blocks to parallelize the computation into; pass -1 for an auto-configured number of blocks. Default: -1.
Set the number of iterations to run.
Set the number of iterations to run. Default: 10.
Set the regularization parameter, lambda.
Set the regularization parameter, lambda. Default: 0.01.
Set the rank of the feature matrices computed (number of features).
Set the rank of the feature matrices computed (number of features). Default: 10.
Compute the new feature vectors for a block of the users matrix given the list of factors it received from each product and its InLinkBlock.
Alternating Least Squares matrix factorization.
This is a blocked implementation of the ALS factorization algorithm that groups the two sets of factors (referred to as "users" and "products") into blocks and reduces communication by only sending one copy of each user vector to each product block on each iteration, and only for the product blocks that need that user's feature vector. This is achieved by precomputing some information about the ratings matrix to determine the "out-links" of each user (which blocks of products it will contribute to) and "in-link" information for each product (which of the feature vectors it receives from each user block it will depend on). This allows us to send only an array of feature vectors between each user block and product block, and have the product block find the users' ratings and update the products based on these messages.