spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MLnick <...@git.apache.org>
Subject [GitHub] spark pull request #18022: [SPARK-20790] [MLlib] Correctly handle negative v...
Date Wed, 31 May 2017 13:00:15 GMT
Github user MLnick commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18022#discussion_r119347220
  
    --- Diff: mllib/src/test/scala/org/apache/spark/ml/recommendation/ALSSuite.scala ---
    @@ -455,6 +487,22 @@ class ALSSuite
           targetRMSE = 0.3)
       }
     
    +  test("implicit feedback regression") {
    +    val trainingWithNeg = sc.parallelize(Array(Rating(0, 0, 1), Rating(1, 1, 1), Rating(0,
1, -3)))
    +    val trainingWithZero = sc.parallelize(Array(Rating(0, 0, 1), Rating(1, 1, 1), Rating(0,
1, 0)))
    +    val modelWithNeg =
    +      trainALS(trainingWithNeg, rank = 1, maxIter = 5, regParam = 0.01, implicitPrefs
= true)
    +    val modelWithZero =
    +      trainALS(trainingWithZero, rank = 1, maxIter = 5, regParam = 0.01, implicitPrefs
= true)
    +    val userFactorsNeg = modelWithNeg.userFactors
    +    val itemFactorsNeg = modelWithNeg.itemFactors
    +    val userFactorsZero = modelWithZero.userFactors
    +    val itemFactorsZero = modelWithZero.itemFactors
    +    userFactorsNeg.collect().foreach(arr => logInfo(s"implicit test " + arr.mkString("
")))
    --- End diff --
    
    Small nit here but ideally we don't usually log info during this sort of test?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message