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

    https://github.com/apache/spark/pull/1687#discussion_r15657314
  
    --- Diff: 
mllib/src/test/java/org/apache/spark/mllib/recommendation/JavaALSSuite.java ---
    @@ -163,12 +173,42 @@ public void runImplicitALSWithNegativeWeight() {
         int iterations = 15;
         int users = 80;
         int products = 160;
    -    scala.Tuple3<List<Rating>, DoubleMatrix, DoubleMatrix> testData = 
ALSSuite.generateRatingsAsJavaList(
    +    Tuple3<List<Rating>, DoubleMatrix, DoubleMatrix> testData = 
ALSSuite.generateRatingsAsJavaList(
             users, products, features, 0.7, true, true);
     
         JavaRDD<Rating> data = sc.parallelize(testData._1());
    -    MatrixFactorizationModel model = ALS.trainImplicit(data.rdd(), 
features, iterations);
    +    MatrixFactorizationModel model = new ALS().setRank(features)
    +        .setIterations(iterations)
    +        .setImplicitPrefs(true)
    +        .setSeed(8675309L)
    +        .run(data.rdd());
         validatePrediction(model, users, products, features, testData._2(), 
0.4, true, testData._3());
       }
     
    +  @Test
    +  public void runRecommend() {
    +    int features = 5;
    +    int iterations = 10;
    +    int users = 200;
    +    int products = 50;
    +    Tuple3<List<Rating>, DoubleMatrix, DoubleMatrix> testData = 
ALSSuite.generateRatingsAsJavaList(
    +        users, products, features, 0.7, true, false);
    +    JavaRDD<Rating> data = sc.parallelize(testData._1());
    +    MatrixFactorizationModel model = new ALS().setRank(features)
    +        .setIterations(iterations)
    --- End diff --
    
    ditto: two space indentation


---
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