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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]