Skip to content

Instantly share code, notes, and snippets.

@niektemme
Created July 31, 2015 10:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Smart Thermostat AWS Spark - part Spark cluster kmeans
val RDDscore = valRowsOnOff.map(result => result._2).map(result => Vectors.dense(result._1,result._2))
RDDscore.cache()
//use mllib k-means clustering to create clusters (temperature groups)
val numClusters = 10
val numIterations = 200
val clusters = KMeans.train(RDDscore, numClusters, numIterations)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment