Github user MLnick commented on a diff in the pull request:
https://github.com/apache/spark/pull/17090#discussion_r103539599
--- Diff:
mllib/src/test/scala/org/apache/spark/ml/recommendation/ALSSuite.scala ---
@@ -547,6 +550,45 @@ class ALSSuite
ALS.train(ratings)
}
}
+
+ test("recommendForAllUsers") {
+ val numUsers = 20
+ val numItems = 40
+ val numRecs = 5
+ val (training, test) = genExplicitTestData(numUsers, numItems, rank =
2, noiseStd = 0.01)
+ val topItems =
+ testALS(training, test, maxIter = 4, rank = 2, regParam = 0.01,
targetRMSE = 0.03)
--- End diff --
Seems wasteful to compute and check a model here, and it doesn't really
test that the predictions are what we expect them to be.
We can construct an `ALSModel` with known factors and check the predictions
are as expected (it's just a matrix multiply). See
`MatrixFactorizationModelSuite` and tests in #12574 (based on those) for
example.
---
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]