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

    https://github.com/apache/spark/pull/7121#discussion_r33561355
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/recommendation/MatrixFactorizationModel.scala
 ---
    @@ -89,10 +89,14 @@ class MatrixFactorizationModel(
        */
       def predict(usersProducts: RDD[(Int, Int)]): RDD[Rating] = {
         val users = userFeatures.join(usersProducts).map {
    -      case (user, (uFeatures, product)) => (product, (user, uFeatures))
    +      case (user, (uFeatures, product)) => ((user, product), uFeatures)
         }
    -    users.join(productFeatures).map {
    -      case (product, ((user, uFeatures), pFeatures)) =>
    +    val productUsers = usersProducts.map(up => (up._2, up._1))
    +    val products = productFeatures.join(productUsers).map {
    --- End diff --
    
    .. but this creates an entire other `join` to compute. This is going to be 
significantly slower, right? How does this relate to the JIRA though -- this is 
a more expensive version of a simple repartitioning, which would also solve it, 
but the point seemed to be to avoid that.


---
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]

Reply via email to