In this section, we review the code where we get the predictions for each label and save them in a text file and draw a two-dimensional scatter plot.
We will create two scatter plots, one for users and the other for items (which is movies in this case):
object MovieLensKMeansPersist { val BASE= "./data/movie_lens_libsvm_2f" val time = System.currentTimeMillis() val formatter = new SimpleDateFormat("dd_MM_yyyy_hh_mm_ss") import java.util.Calendar val calendar = Calendar.getInstance() calendar.setTimeInMillis(time) val date_time = formatter.format(calendar.getTime()) def main(args: Array[String]): Unit = { val spConfig = ( new SparkConf).setMaster("local[1]"). setAppName("SparkApp"). set("spark.driver.allowMultipleContexts", ...