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

    https://github.com/apache/spark/pull/9020#discussion_r41490463
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala 
---
    @@ -512,6 +513,92 @@ object Vectors {
         squaredDistance
       }
     
    +  private def dot(a : DenseVector, b : DenseVector) : Double = {
    +    (a.toArray zip b.toArray).map(x => (x._1 * x._2)).sum
    +  }
    +
    +  private def dot(a : SparseVector, b : DenseVector) : Double = {
    +    (a.indices zip a.values).map(x => { b(x._1)*x._2 }).sum
    --- End diff --
    
    This probably won't work as it makes the sparse vector dense. In general I 
think these are slower than the Breeze impl. I also question the value of the 
Hadamard product as I've never actually had it come up. 


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