Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/597#discussion_r12407659
--- Diff:
examples/src/main/scala/org/apache/spark/examples/mllib/MovieLensALS.scala ---
@@ -99,7 +123,18 @@ object MovieLensALS {
val splits = ratings.randomSplit(Array(0.8, 0.2))
val training = splits(0).cache()
- val test = splits(1).cache()
+ val test = if (params.implicitPrefs) {
+ /*
+ * 0 means "don't know" and positive values mean "confident that the
prediction should be 1".
+ * Negative values means "confident that the prediction should be 0".
+ * We have in this case used some kind of weighted RMSE. The weight
is the absolute value of
+ * the confidence. The error is the difference between prediction
and either 1 or 0,
+ * depending on whether r is positive or negative.
+ */
+ splits(1).map(x => Rating(x.user, x.product, if(x.rating > 0) 1.0
else 0.0))
--- End diff --
Add a space after `if`.
---
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.
---