Github user da-steve101 commented on a diff in the pull request:
https://github.com/apache/spark/pull/9020#discussion_r41537324
--- 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 --
Fair enough, changed to breeze
I was using hadamard for Kij * (yi*yj) in an SVM implementation and was
more convenient to use vector element wise when storing as a row matrix
---
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]