Home Index

1. Apache Spark

2. Resource Files

Apache Spark / Resource Files /

Read file from resource directory and build predition model.

val ratings = spark.textFile(this.getClass.getResource("/flat-file.dat").getPath)

val Array(training, test) = ratings.randomSplit(Array(0.8, 0.2))

// Build the recommnetation model usil ALS on the training data
val als = new ALS()

// Evaluate the model by comparing the RMSE on the test data
val model =
val predictions = model.transform(test)