May 2017
Intermediate to advanced
294 pages
7h 33m
English
The following is the method signature of vectors.dense:
def dense(values: Array[Double]): Vector
Here, values represent a double array of elements in the vector.
The following is the method signature of Vectors.sparse:
def sparse(size: Int, indices: Array[Int], values: Array[Double]): Vector
Here, size represents the size of the vector, indices is an array of indices, and values is an array of values as doubles. Do make sure you specify double as a datatype or use decimal in at least one value; otherwise, it will throw an exception for the dataset, which has only integer.
Read now
Unlock full access