O'Reilly logo

Machine Learning with Spark - Second Edition by Nick Pentreath, Manpreet Singh Ghotra, Rajdeep Dua

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

WSSSE and iterations

In this section, we evaluate the effect or iterations on WSSSE for bisecting the K-means algorithm.

The source code is:

object BisectingKMeansMetrics {   case class RatingX(userId: Int, movieId: Int,      rating: Float, timestamp: Long)   val DATA_PATH= "../../../data/ml-100k"   val PATH_MOVIES = DATA_PATH + "/u.item"   val dataSetUsers = null   def main(args: Array[String]): Unit = {     val spConfig = (       new SparkConf).setMaster("local[1]").setAppName("SparkApp").       set("spark.driver.allowMultipleContexts", "true")     val spark = SparkSession       .builder()       .appName("Spark SQL Example")       .config(spConfig)       .getOrCreate()     val datasetUsers = spark.read.format("libsvm").load(       "./data/movie_lens_libsvm/movie_lens_users_libsvm/part-

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required