Smart Thermostat AWS Spark - part Spark cluster kmeans
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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