Step 1 - Creating a Spark session

Let's create a Spark session by defining the number of computing cores, the SQL warehouse, and the application name as follows:

val spark = SparkSession    .builder    .master("local[*]")    .config("spark.sql.warehouse.dir", "C:/data/")    .appName(s"LDA")    .getOrCreate()

Get Scala Machine Learning Projects 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.