How to substract one DenseVector from another in Spark MLLib

20 Views Asked by At

a and b are two spark.mllib.linalg.DenseVectors:

import org.apache.spark.mllib.linalg.DenseVector

...
val a = DenseVector(Array(1.0, 2.0, 3.0))
val b = DenseVector(Array(2.0, 3.0, 1.0))
...

I want to get c as subtraction of b from c. How to do it?

0

There are 0 best solutions below