find max val

This commit is contained in:
joedarby
2016-12-16 16:34:02 +00:00
parent f5755b193c
commit 900926fc34
+2
View File
@@ -17,6 +17,8 @@ object KMeans {
val rows = relevantData.rdd
//val rowsAsArray = rows.map(row => List(row.getInt(0).toFloat, row.getInt(1).toFloat, row.getInt(2).toFloat) )
val rowsAsArray = rows.map(row => row.getInt(0).toFloat )
val maximum = rowsAsArray.reduce((a,b) => math.max(a,b))
println(maximum)
//rowsAsArray.foreach(println)
val K = 4 //number of intended clusters
//val n = rows.count() //number of datapoints