There's more...

  1. One must remember that the dense and SparseVectors are local vectors and they must not be confused with the distributed facilities (for example, distributed matrices such as the RowMatrix class).
  2. The underlying math operations for the vectors on a local machine will be provided by two libraries:

There is another data structure related directly to Vectors called LabeledPoint, which we covered in Chapter 4Common Recipes for Implementing a Robust Machine Learning System. In short, it is a data structure corresponding to LIBSVM and LIBLINEAR formats for storing ML data consisting of a feature vector plus a label (for example, independent and dependent variables ...

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.