Apache Spark 2.x Machine Learning Cookbook
上QQ阅读APP看书,第一时间看更新

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 in a regression):