In this recipe, we explore matrix creation examples that you most likely would need in your Scala programming and while reading the source code for many of the open source libraries for machine learning.
Spark provides two distinct types of local matrix facilities (dense and sparse) for storage and manipulation of data at a local level. For simplicity, one way to think of a matrix is to visualize it as columns of Vectors.