Reputation: 2883
I have quite big vector of around 20k Doubles most of which are null. Is it possible to convert it to the SparseVector and how?
Upvotes: 0
Views: 99
Reputation: 21
org.apache.spark.ml.linalg.Vector
provides toSparse
and toDense
methods which can be used to change the representation.
However it shouldn't possible to have Vector
(or any other collection like object) of scala.Double
containing nulls
in the first place.
Upvotes: 2