org.apache.spark.mllib.recommendation

ALS

class ALS extends Serializable

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.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ALS
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ALS()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. var iterations: Int

  15. var lambda: Double

  16. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. var numBlocks: Int

  20. var rank: Int

  21. def run(ratings: RDD[Rating]): MatrixFactorizationModel

    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.

  22. def setBlocks(numBlocks: Int): ALS

    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.

  23. def setIterations(iterations: Int): ALS

    Set the number of iterations to run.

    Set the number of iterations to run. Default: 10.

  24. def setLambda(lambda: Double): ALS

    Set the regularization parameter, lambda.

    Set the regularization parameter, lambda. Default: 0.01.

  25. def setRank(rank: Int): ALS

    Set the rank of the feature matrices computed (number of features).

    Set the rank of the feature matrices computed (number of features). Default: 10.

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. def updateBlock(messages: Seq[(Int, Array[Array[Double]])], inLinkBlock: InLinkBlock, rank: Int, lambda: Double): Array[Array[Double]]

    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.

  29. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  30. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any