- Start a new project in IntelliJ or in an IDE of your choice. Make sure that the necessary JAR files are included.
- Set up the package location where the program will reside:
package spark.ml.cookbook.chapter2
- Import the necessary packages for vector and matrix manipulation:
import org.apache.spark.mllib.linalg.distributed.RowMatriximport org.apache.spark.mllib.linalg.distributed.{IndexedRow, IndexedRowMatrix}import org.apache.spark.mllib.linalg.distributed.{CoordinateMatrix, MatrixEntry}import org.apache.spark.sql.{SparkSession}import org.apache.spark.rdd._import org.apache.spark.mllib.linalg._import breeze.linalg.{DenseVector => BreezeVector}import Array._import org.apache.spark.mllib.linalg.DenseMatriximport org.apache.spark.mllib.linalg.SparseVector ...