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

    https://github.com/apache/spark/pull/597#discussion_r12362778
  
    --- Diff: 
examples/src/main/scala/org/apache/spark/examples/mllib/MovieLensALS.scala ---
    @@ -88,7 +92,11 @@ object MovieLensALS {
     
         val ratings = sc.textFile(params.input).map { line =>
           val fields = line.split("::")
    -      Rating(fields(0).toInt, fields(1).toInt, fields(2).toDouble)
    +      if (params.implicitPrefs) {
    +        Rating(fields(0).toInt, fields(1).toInt, fields(2).toDouble - 2.5)
    --- End diff --
    
    ```
            /**
             * MovieLens ratings are on a scale of 1-5:
             * 5: Must see
             * 4: Will enjoy
             * 3: It's okay
             * 2: Fairly bad
             * 1: Awful
             * So we should not recommend a movie if the predicted rating is 
less than 3.
             * To map ratings to confidence scores, we use
             * 5 -> 2.5, 4 -> 1.5, 3 -> 0.5, 2 -> -0.5, 1 -> -1.5. This 
mappings means unobserved
             * entries are generally between It's okay and Fairly bad.
             * The semantics of 0 in this expanded world of non-positive weights
             * are "the same as never having interacted at all" -- which 
doesn't quite fit.
             * It's possible that 0 values are ignored when constructing the 
sparse representation,
             * because the 0s are implicit. This would be a problem, at least, 
a theoretical one.
             */
    ```


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

Reply via email to