I have an RDD of type RDD[(Int,Double)] in which the first element of the pair is the index and the second is the value and I'd like to convert this RDD to a Vector to use for classification. Could someone help me with that?
I have the following code but it's not working
def vectorize(x:RDD[(Int,Double)], size: Int):Vector = {
val vec = Vectors.sparse(size,x)
}