Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/460#discussion_r11985249
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/recommendation/ALS.scala ---
    @@ -537,6 +566,34 @@ object ALS {
        * 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`, partitioning the data using the 
Partitioner `partitioner`.
    +   *
    +   * @param ratings     RDD of (userID, productID, rating) pairs
    +   * @param rank        number of features to use
    +   * @param iterations  number of iterations of ALS (recommended: 10-20)
    +   * @param lambda      regularization factor (recommended: 0.01)
    +   * @param blocks      level of parallelism to split computation into
    +   * @param seed        random seed
    +   * @param nonnegative Whether to impose nonnegativity constraints
    +   */
    +  def train(
    +      ratings: RDD[Rating],
    +      rank: Int,
    +      iterations: Int,
    +      lambda: Double,
    +      blocks: Int,
    +      seed: Long,
    +      nonnegative: Boolean) = {
    --- End diff --
    
    Those static methods shouldn't be used for more than 3 parameters. It is 
extremely hard to remember the order. Even with docs, they are still not user 
friendly. I'm actually okay with removing this static method and using the 
builder pattern to create an ALS instance.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to