org.apache.spark.mllib.recommendation

ALS

object ALS extends Serializable

Top-level methods for calling Alternating Least Squares (ALS) matrix factorization.

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

Type Members

  1. case class BlockStats(category: String, index: Int, count: Long, numRatings: Long, numInLinks: Long, numOutLinks: Long) extends Product with Serializable

    :: DeveloperApi :: Statistics of a block in ALS computation.

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. def analyzeBlocks(ratings: RDD[Rating], numUserBlocks: Int, numProductBlocks: Int): Array[BlockStats]

    :: DeveloperApi :: Given an RDD of ratings, number of user blocks, and number of product blocks, computes the statistics of each block in ALS computation.

    :: DeveloperApi :: Given an RDD of ratings, number of user blocks, and number of product blocks, computes the statistics of each block in ALS computation. This is useful for estimating cost and diagnosing load balance.

    ratings

    an RDD of ratings

    numUserBlocks

    number of user blocks

    numProductBlocks

    number of product blocks

    returns

    statistics of user blocks and product blocks

    Annotations
    @DeveloperApi()
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

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

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

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

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

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

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

    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  19. def toString(): String

    Definition Classes
    AnyRef → Any
  20. def train(ratings: RDD[Rating], rank: Int, iterations: Int): MatrixFactorizationModel

    Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs.

    Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs. We approximate the ratings matrix as the product of two lower-rank matrices of a given rank (number of features). To solve for these features, we run a given number of iterations of ALS. The level of parallelism is determined automatically based on the number of partitions in ratings.

    ratings

    RDD of (userID, productID, rating) pairs

    rank

    number of features to use

    iterations

    number of iterations of ALS (recommended: 10-20)

  21. def train(ratings: RDD[Rating], rank: Int, iterations: Int, lambda: Double): MatrixFactorizationModel

    Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs.

    Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs. We approximate the ratings matrix as the product of two lower-rank matrices of a given rank (number of features). To solve for these features, we run a given number of iterations of ALS. The level of parallelism is determined automatically based on the number of partitions in ratings.

    ratings

    RDD of (userID, productID, rating) pairs

    rank

    number of features to use

    iterations

    number of iterations of ALS (recommended: 10-20)

    lambda

    regularization factor (recommended: 0.01)

  22. def train(ratings: RDD[Rating], rank: Int, iterations: Int, lambda: Double, blocks: Int): MatrixFactorizationModel

    Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs.

    Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs. We approximate the ratings matrix as the product of two lower-rank matrices of a given rank (number of features). To solve for these features, we run a given number of iterations of ALS. This is done using a level of parallelism given by blocks.

    ratings

    RDD of (userID, productID, rating) pairs

    rank

    number of features to use

    iterations

    number of iterations of ALS (recommended: 10-20)

    lambda

    regularization factor (recommended: 0.01)

    blocks

    level of parallelism to split computation into

  23. def train(ratings: RDD[Rating], rank: Int, iterations: Int, lambda: Double, blocks: Int, seed: Long): MatrixFactorizationModel

    Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs.

    Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs. We approximate the ratings matrix as the product of two lower-rank matrices of a given rank (number of features). To solve for these features, we run a given number of iterations of ALS. This is done using a level of parallelism given by blocks.

    ratings

    RDD of (userID, productID, rating) pairs

    rank

    number of features to use

    iterations

    number of iterations of ALS (recommended: 10-20)

    lambda

    regularization factor (recommended: 0.01)

    blocks

    level of parallelism to split computation into

    seed

    random seed

  24. def trainImplicit(ratings: RDD[Rating], rank: Int, iterations: Int): MatrixFactorizationModel

    Train a matrix factorization model given an RDD of 'implicit preferences' ratings given by users to some products, in the form of (userID, productID, rating) pairs.

    Train a matrix factorization model given an RDD of 'implicit preferences' ratings given by users to some products, in the form of (userID, productID, rating) pairs. We approximate the ratings matrix as the product of two lower-rank matrices of a given rank (number of features). To solve for these features, we run a given number of iterations of ALS. The level of parallelism is determined automatically based on the number of partitions in ratings. Model parameters alpha and lambda are set to reasonable default values

    ratings

    RDD of (userID, productID, rating) pairs

    rank

    number of features to use

    iterations

    number of iterations of ALS (recommended: 10-20)

  25. def trainImplicit(ratings: RDD[Rating], rank: Int, iterations: Int, lambda: Double, alpha: Double): MatrixFactorizationModel

    Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs.

    Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs. We approximate the ratings matrix as the product of two lower-rank matrices of a given rank (number of features). To solve for these features, we run a given number of iterations of ALS. The level of parallelism is determined automatically based on the number of partitions in ratings.

    ratings

    RDD of (userID, productID, rating) pairs

    rank

    number of features to use

    iterations

    number of iterations of ALS (recommended: 10-20)

    lambda

    regularization factor (recommended: 0.01)

    alpha

    confidence parameter

  26. def trainImplicit(ratings: RDD[Rating], rank: Int, iterations: Int, lambda: Double, blocks: Int, alpha: Double): MatrixFactorizationModel

    Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs.

    Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs. We approximate the ratings matrix as the product of two lower-rank matrices of a given rank (number of features). To solve for these features, we run a given number of iterations of ALS. This is done using a level of parallelism given by blocks.

    ratings

    RDD of (userID, productID, rating) pairs

    rank

    number of features to use

    iterations

    number of iterations of ALS (recommended: 10-20)

    lambda

    regularization factor (recommended: 0.01)

    blocks

    level of parallelism to split computation into

    alpha

    confidence parameter

  27. def trainImplicit(ratings: RDD[Rating], rank: Int, iterations: Int, lambda: Double, blocks: Int, alpha: Double, seed: Long): MatrixFactorizationModel

    Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs.

    Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs. We approximate the ratings matrix as the product of two lower-rank matrices of a given rank (number of features). To solve for these features, we run a given number of iterations of ALS. This is done using a level of parallelism given by blocks.

    ratings

    RDD of (userID, productID, rating) pairs

    rank

    number of features to use

    iterations

    number of iterations of ALS (recommended: 10-20)

    lambda

    regularization factor (recommended: 0.01)

    blocks

    level of parallelism to split computation into

    alpha

    confidence parameter

    seed

    random seed

  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped